summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-04-13 17:48:16 +0300
committerGitHub <noreply@github.com>2020-04-13 17:48:16 +0300
commitb841f798f8b0eb540c0f51ea294ee44576a21111 (patch)
tree044cfdc75a9e2512e113a186de6a8f79bf273449
parenta68ecc079d13170a646c502977069233f14f0be1 (diff)
parent35ae07e2a65c5ab5ba6784cdb67631918a41ccc3 (diff)
downloadwekan-b841f798f8b0eb540c0f51ea294ee44576a21111.tar.gz
wekan-b841f798f8b0eb540c0f51ea294ee44576a21111.tar.bz2
wekan-b841f798f8b0eb540c0f51ea294ee44576a21111.zip
Merge pull request #3013 from salleman33/master
debug isBoardAdmin on main page
-rw-r--r--client/components/boards/boardsList.jade2
-rw-r--r--client/components/boards/boardsList.js4
-rw-r--r--models/users.js4
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);
},
});