mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Move every Users.findOne(idOrFirstObjectSelector, options) to the ReactiveCache
This commit is contained in:
parent
68610e5066
commit
0767f50af8
17 changed files with 43 additions and 33 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { Exporter } from './exporter';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
|
||||
|
|
@ -43,7 +44,7 @@ if (Meteor.isServer) {
|
|||
});
|
||||
} else if (!Meteor.settings.public.sandstorm) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
user = Users.findOne({ _id: req.userId, isAdmin: true });
|
||||
user = ReactiveCache.getUser({ _id: req.userId, isAdmin: true });
|
||||
}
|
||||
const exporter = new Exporter(boardId);
|
||||
if (exporter.canExport(user) || impersonateDone) {
|
||||
|
|
@ -107,7 +108,7 @@ if (Meteor.isServer) {
|
|||
});
|
||||
} else if (!Meteor.settings.public.sandstorm) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
user = Users.findOne({ _id: req.userId, isAdmin: true });
|
||||
user = ReactiveCache.getUser({ _id: req.userId, isAdmin: true });
|
||||
}
|
||||
const exporter = new Exporter(boardId, attachmentId);
|
||||
if (exporter.canExport(user) || impersonateDone) {
|
||||
|
|
@ -163,7 +164,7 @@ if (Meteor.isServer) {
|
|||
});
|
||||
} else if (!Meteor.settings.public.sandstorm) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
user = Users.findOne({
|
||||
user = ReactiveCache.getUser({
|
||||
_id: req.userId,
|
||||
isAdmin: true,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue