mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
Utils of canModifyCard and canModifyBoard + move this general functions to Utils class
This commit is contained in:
parent
b29ec93c34
commit
583f114c68
10 changed files with 28 additions and 135 deletions
|
|
@ -58,6 +58,25 @@ Utils = {
|
|||
const ret = Cards.findOne(cardId);
|
||||
return ret;
|
||||
},
|
||||
canModifyCard() {
|
||||
const currentUser = Meteor.user();
|
||||
const ret = (
|
||||
currentUser &&
|
||||
currentUser.isBoardMember() &&
|
||||
!currentUser.isCommentOnly() &&
|
||||
!currentUser.isWorker()
|
||||
);
|
||||
return ret;
|
||||
},
|
||||
canModifyBoard() {
|
||||
const currentUser = Meteor.user();
|
||||
const ret = (
|
||||
currentUser &&
|
||||
currentUser.isBoardMember() &&
|
||||
!currentUser.isCommentOnly()
|
||||
);
|
||||
return ret;
|
||||
},
|
||||
reload() {
|
||||
// we move all window.location.reload calls into this function
|
||||
// so we can disable it when running tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue