mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 07:24:07 +01:00
Use sync code in allow/deny for 2.x
This commit is contained in:
parent
f934aea2a5
commit
e77be37450
28 changed files with 594 additions and 410 deletions
|
|
@ -164,28 +164,28 @@ CustomFields.helpers({
|
|||
});
|
||||
|
||||
CustomFields.allow({
|
||||
async insert(userId, doc) {
|
||||
insert(userId, doc) {
|
||||
return allowIsAnyBoardMember(
|
||||
userId,
|
||||
await ReactiveCache.getBoards({
|
||||
Boards.find({
|
||||
_id: { $in: doc.boardIds },
|
||||
}),
|
||||
}).fetch(),
|
||||
);
|
||||
},
|
||||
async update(userId, doc) {
|
||||
update(userId, doc) {
|
||||
return allowIsAnyBoardMember(
|
||||
userId,
|
||||
await ReactiveCache.getBoards({
|
||||
Boards.find({
|
||||
_id: { $in: doc.boardIds },
|
||||
}),
|
||||
}).fetch(),
|
||||
);
|
||||
},
|
||||
async remove(userId, doc) {
|
||||
remove(userId, doc) {
|
||||
return allowIsAnyBoardMember(
|
||||
userId,
|
||||
await ReactiveCache.getBoards({
|
||||
Boards.find({
|
||||
_id: { $in: doc.boardIds },
|
||||
}),
|
||||
}).fetch(),
|
||||
);
|
||||
},
|
||||
fetch: ['userId', 'boardIds'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue