Add some permission code, to see does it fix something.

Thanks to xet7 !

Related #3377
This commit is contained in:
Lauri Ojansivu 2020-12-17 21:27:02 +02:00
parent 8481c791d7
commit 7f3c4acf62
8 changed files with 117 additions and 50 deletions

View file

@ -155,6 +155,9 @@ Template.memberPopup.helpers({
user() {
return Users.findOne(this.userId);
},
isBoardAdmin() {
return Meteor.user().isBoardAdmin();
},
memberType() {
const type = Users.findOne(this.userId).isBoardAdmin() ? 'admin' : 'normal';
if (type === 'normal') {
@ -224,6 +227,9 @@ Template.boardMenuPopup.onCreated(function() {
});
Template.boardMenuPopup.helpers({
isBoardAdmin() {
return Meteor.user().isBoardAdmin();
},
withApi() {
return Template.instance().apiEnabled.get();
},
@ -294,6 +300,9 @@ Template.membersWidget.helpers({
return false;
}
},
isBoardAdmin() {
return Meteor.user().isBoardAdmin();
},
});
Template.membersWidget.events({
@ -475,6 +484,12 @@ Template.labelsWidget.events({
'click .js-add-label': Popup.open('createLabel'),
});
Template.labelsWidget.helpers({
isBoardAdmin() {
return Meteor.user().isBoardAdmin();
},
});
// Board members can assign people or labels by drag-dropping elements from the
// sidebar to the cards on the board. In order to re-initialize the jquery-ui
// plugin any time a draggable member or label is modified or removed we use a