mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 09:38:49 +01:00
Add some permission code, to see does it fix something.
Thanks to xet7 ! Related #3377
This commit is contained in:
parent
8481c791d7
commit
7f3c4acf62
8 changed files with 117 additions and 50 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue