mirror of
https://github.com/wekan/wekan.git
synced 2026-02-24 08:54:06 +01:00
Move every Users.findOne() to the ReactiveCache
This commit is contained in:
parent
bf48d4371c
commit
6e1ef3d94a
35 changed files with 175 additions and 125 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
|
||||
Announcements = new Mongo.Collection('announcements');
|
||||
|
||||
Announcements.attachSchema(
|
||||
|
|
@ -49,7 +51,7 @@ Announcements.attachSchema(
|
|||
|
||||
Announcements.allow({
|
||||
update(userId) {
|
||||
const user = Users.findOne(userId);
|
||||
const user = ReactiveCache.getUser(userId);
|
||||
return user && user.isAdmin;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue