mirror of
https://github.com/wekan/wekan.git
synced 2026-01-03 08:08:49 +01:00
Move every Boards.findOne(boardId) to the ReactiveCache (Part 2)
This commit is contained in:
parent
9022e9949f
commit
a182482cfb
37 changed files with 166 additions and 127 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { FilesCollection } from 'meteor/ostrio:files';
|
||||
import { isFileValid } from './fileValidation';
|
||||
|
|
@ -122,7 +123,7 @@ Attachments = new FilesCollection({
|
|||
return false;
|
||||
}
|
||||
|
||||
const board = Boards.findOne(fileObj.meta.boardId);
|
||||
const board = ReactiveCache.getBoard(fileObj.meta.boardId);
|
||||
if (board.isPublic()) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -134,13 +135,13 @@ Attachments = new FilesCollection({
|
|||
if (Meteor.isServer) {
|
||||
Attachments.allow({
|
||||
insert(userId, fileObj) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(fileObj.boardId));
|
||||
return allowIsBoardMember(userId, ReactiveCache.getBoard(fileObj.boardId));
|
||||
},
|
||||
update(userId, fileObj) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(fileObj.boardId));
|
||||
return allowIsBoardMember(userId, ReactiveCache.getBoard(fileObj.boardId));
|
||||
},
|
||||
remove(userId, fileObj) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(fileObj.boardId));
|
||||
return allowIsBoardMember(userId, ReactiveCache.getBoard(fileObj.boardId));
|
||||
},
|
||||
fetch: ['meta'],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue