mirror of
https://github.com/wekan/wekan.git
synced 2026-02-13 11:44:20 +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 escapeForRegex from 'escape-string-regexp';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
|
|
@ -74,13 +75,13 @@ CardComments.attachSchema(
|
|||
|
||||
CardComments.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
return allowIsBoardMember(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
update(userId, doc) {
|
||||
return userId === doc.userId || allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
return userId === doc.userId || allowIsBoardAdmin(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return userId === doc.userId || allowIsBoardAdmin(userId, Boards.findOne(doc.boardId));
|
||||
return userId === doc.userId || allowIsBoardAdmin(userId, ReactiveCache.getBoard(doc.boardId));
|
||||
},
|
||||
fetch: ['userId', 'boardId'],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue