Utils of canModifyCard and canModifyBoard + move this general functions to Utils class

This commit is contained in:
Martin Filser 2022-01-11 19:26:59 +01:00
parent b29ec93c34
commit 583f114c68
10 changed files with 28 additions and 135 deletions

View file

@ -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.