mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +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
|
|
@ -3,6 +3,10 @@ BlazeComponent.extendComponent({
|
||||||
this.subscribe('archivedBoards');
|
this.subscribe('archivedBoards');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
|
||||||
archivedBoards() {
|
archivedBoards() {
|
||||||
return Boards.find(
|
return Boards.find(
|
||||||
{ archived: true },
|
{ archived: true },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,13 @@
|
||||||
Template.attachmentsGalery.events({
|
Template.attachmentsGalery.events({});
|
||||||
|
|
||||||
|
BlazeComponent.extendComponent({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
|
||||||
|
events() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
'click .js-add-attachment': Popup.open('cardAttachments'),
|
'click .js-add-attachment': Popup.open('cardAttachments'),
|
||||||
'click .js-confirm-delete': Popup.afterConfirm(
|
'click .js-confirm-delete': Popup.afterConfirm(
|
||||||
'attachmentDelete',
|
'attachmentDelete',
|
||||||
|
|
@ -43,7 +52,10 @@ Template.attachmentsGalery.events({
|
||||||
if (img.src === url && img.complete) rePosPopup();
|
if (img.src === url && img.complete) rePosPopup();
|
||||||
else img.onload = rePosPopup;
|
else img.onload = rePosPopup;
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
}).register('attachmentsGalery');
|
||||||
|
|
||||||
Template.previewAttachedImagePopup.events({
|
Template.previewAttachedImagePopup.events({
|
||||||
'click .js-large-image-clicked'() {
|
'click .js-large-image-clicked'() {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ template(name="checklistDetail")
|
||||||
.checklist-title
|
.checklist-title
|
||||||
span
|
span
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
if currentUser.isBoardAdmin
|
|
||||||
a.js-delete-checklist.toggle-delete-checklist-dialog {{_ "delete"}}...
|
a.js-delete-checklist.toggle-delete-checklist-dialog {{_ "delete"}}...
|
||||||
|
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
|
|
@ -60,7 +59,6 @@ template(name="checklistDeleteDialog")
|
||||||
| {{_ 'confirm-checklist-delete-dialog'}}
|
| {{_ 'confirm-checklist-delete-dialog'}}
|
||||||
span {{checklist.title}}
|
span {{checklist.title}}
|
||||||
| ?
|
| ?
|
||||||
if currentUser.isBoardAdmin
|
|
||||||
.js-checklist-delete-buttons
|
.js-checklist-delete-buttons
|
||||||
button.confirm-checklist-delete(type="button") {{_ 'delete'}}
|
button.confirm-checklist-delete(type="button") {{_ 'delete'}}
|
||||||
button.toggle-delete-checklist-dialog(type="button") {{_ 'cancel'}}
|
button.toggle-delete-checklist-dialog(type="button") {{_ 'cancel'}}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,10 @@ BlazeComponent.extendComponent({
|
||||||
}).register('listHeader');
|
}).register('listHeader');
|
||||||
|
|
||||||
Template.listHeader.helpers({
|
Template.listHeader.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
|
||||||
showDesktopDragHandles() {
|
showDesktopDragHandles() {
|
||||||
currentUser = Meteor.user();
|
currentUser = Meteor.user();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
|
|
@ -117,6 +121,10 @@ Template.listHeader.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.listActionPopup.helpers({
|
Template.listActionPopup.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
|
||||||
isWipLimitEnabled() {
|
isWipLimitEnabled() {
|
||||||
return Template.currentData().getWipLimit('enabled');
|
return Template.currentData().getWipLimit('enabled');
|
||||||
},
|
},
|
||||||
|
|
@ -254,6 +262,12 @@ Template.listMorePopup.events({
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.listHeader.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.currentList = this.currentData();
|
this.currentList = this.currentData();
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,9 @@ Template.memberPopup.helpers({
|
||||||
user() {
|
user() {
|
||||||
return Users.findOne(this.userId);
|
return Users.findOne(this.userId);
|
||||||
},
|
},
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
memberType() {
|
memberType() {
|
||||||
const type = Users.findOne(this.userId).isBoardAdmin() ? 'admin' : 'normal';
|
const type = Users.findOne(this.userId).isBoardAdmin() ? 'admin' : 'normal';
|
||||||
if (type === 'normal') {
|
if (type === 'normal') {
|
||||||
|
|
@ -224,6 +227,9 @@ Template.boardMenuPopup.onCreated(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.boardMenuPopup.helpers({
|
Template.boardMenuPopup.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
withApi() {
|
withApi() {
|
||||||
return Template.instance().apiEnabled.get();
|
return Template.instance().apiEnabled.get();
|
||||||
},
|
},
|
||||||
|
|
@ -294,6 +300,9 @@ Template.membersWidget.helpers({
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.membersWidget.events({
|
Template.membersWidget.events({
|
||||||
|
|
@ -475,6 +484,12 @@ Template.labelsWidget.events({
|
||||||
'click .js-add-label': Popup.open('createLabel'),
|
'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
|
// 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
|
// 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
|
// plugin any time a draggable member or label is modified or removed we use a
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,9 @@ BlazeComponent.extendComponent({
|
||||||
}).register('archivesSidebar');
|
}).register('archivesSidebar');
|
||||||
|
|
||||||
Template.archivesSidebar.helpers({
|
Template.archivesSidebar.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
isWorker() {
|
isWorker() {
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,15 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('multiselectionSidebar');
|
}).register('multiselectionSidebar');
|
||||||
|
|
||||||
|
Template.multiselectionSidebar.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
isCommentOnly() {
|
||||||
|
return Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.disambiguateMultiLabelPopup.events({
|
Template.disambiguateMultiLabelPopup.events({
|
||||||
'click .js-remove-label'() {
|
'click .js-remove-label'() {
|
||||||
mutateSelectedCards('removeLabel', this._id);
|
mutateSelectedCards('removeLabel', this._id);
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,12 @@ Template.swimlaneHeader.helpers({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.swimlaneFixedHeader.helpers({
|
||||||
|
isBoardAdmin() {
|
||||||
|
return Meteor.user().isBoardAdmin();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
Template.swimlaneActionPopup.events({
|
Template.swimlaneActionPopup.events({
|
||||||
'click .js-set-swimlane-color': Popup.open('setSwimlaneColor'),
|
'click .js-set-swimlane-color': Popup.open('setSwimlaneColor'),
|
||||||
'click .js-close-swimlane'(event) {
|
'click .js-close-swimlane'(event) {
|
||||||
|
|
@ -50,6 +56,12 @@ Template.swimlaneActionPopup.events({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.swimlaneActionPopup.helpers({
|
||||||
|
isCommentOnly() {
|
||||||
|
return Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
onCreated() {
|
onCreated() {
|
||||||
this.currentSwimlane = this.currentData();
|
this.currentSwimlane = this.currentData();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue