mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 15:34: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
|
|
@ -69,17 +69,17 @@ ChecklistItems.attachSchema(
|
|||
);
|
||||
|
||||
ChecklistItems.allow({
|
||||
async insert(userId, doc) {
|
||||
insert(userId, doc) {
|
||||
// ReadOnly users cannot create checklist items
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, Cards.findOne(doc.cardId));
|
||||
},
|
||||
async update(userId, doc) {
|
||||
update(userId, doc) {
|
||||
// ReadOnly users cannot edit checklist items
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, Cards.findOne(doc.cardId));
|
||||
},
|
||||
async remove(userId, doc) {
|
||||
remove(userId, doc) {
|
||||
// ReadOnly users cannot delete checklist items
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, await ReactiveCache.getCard(doc.cardId));
|
||||
return allowIsBoardMemberWithWriteAccessByCard(userId, Cards.findOne(doc.cardId));
|
||||
},
|
||||
fetch: ['userId', 'cardId'],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue