diff options
author | salleman <salleman@wingit.math.u-bordeaux.fr> | 2020-04-13 15:46:29 +0200 |
---|---|---|
committer | salleman <salleman@wingit.math.u-bordeaux.fr> | 2020-04-13 15:46:29 +0200 |
commit | 35ae07e2a65c5ab5ba6784cdb67631918a41ccc3 (patch) | |
tree | 044cfdc75a9e2512e113a186de6a8f79bf273449 | |
parent | a68ecc079d13170a646c502977069233f14f0be1 (diff) | |
download | wekan-35ae07e2a65c5ab5ba6784cdb67631918a41ccc3.tar.gz wekan-35ae07e2a65c5ab5ba6784cdb67631918a41ccc3.tar.bz2 wekan-35ae07e2a65c5ab5ba6784cdb67631918a41ccc3.zip |
debug isBoardAdmin on main page
-rw-r--r-- | client/components/boards/boardsList.jade | 2 | ||||
-rw-r--r-- | client/components/boards/boardsList.js | 4 | ||||
-rw-r--r-- | models/users.js | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/client/components/boards/boardsList.jade b/client/components/boards/boardsList.jade index f1118aa8..46086693 100644 --- a/client/components/boards/boardsList.jade +++ b/client/components/boards/boardsList.jade @@ -39,7 +39,7 @@ template(name="boardList") i.fa.js-archive-board( class="fa-archive" title="{{_ 'archive-board'}}") - else if currentUser.isBoardAdmin + else if isAdministrable i.fa.js-clone-board( class="fa-clone" title="{{_ 'duplicate-board'}}") diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 0ff1c4fb..65bed16a 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -42,6 +42,10 @@ BlazeComponent.extendComponent({ const user = Meteor.user(); return user && user.hasStarred(this.currentData()._id); }, + isAdministrable() { + const user = Meteor.user(); + return user && user.isBoardAdmin(this.currentData()._id); + }, hasOvertimeCards() { subManager.subscribe('board', this.currentData()._id, false); diff --git a/models/users.js b/models/users.js index 3700d1c8..a9eeb38b 100644 --- a/models/users.js +++ b/models/users.js @@ -377,8 +377,8 @@ if (Meteor.isClient) { return board && board.hasWorker(this._id); }, - isBoardAdmin() { - const board = Boards.findOne(Session.get('currentBoard')); + isBoardAdmin(boardId = Session.get('currentBoard')) { + const board = Boards.findOne(boardId); return board && board.hasAdmin(this._id); }, }); |