mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 09:38:49 +01:00
Utils of canModifyCard and canModifyBoard + move this general functions to Utils class
This commit is contained in:
parent
b29ec93c34
commit
583f114c68
10 changed files with 28 additions and 135 deletions
|
|
@ -1,14 +1,3 @@
|
|||
BlazeComponent.extendComponent({
|
||||
canModifyCard() {
|
||||
return (
|
||||
Meteor.user() &&
|
||||
Meteor.user().isBoardMember() &&
|
||||
!Meteor.user().isCommentOnly() &&
|
||||
!Meteor.user().isWorker()
|
||||
);
|
||||
},
|
||||
}).register('subtaskDetail');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
addSubtask(event) {
|
||||
event.preventDefault();
|
||||
|
|
@ -70,15 +59,6 @@ BlazeComponent.extendComponent({
|
|||
textarea.focus();
|
||||
},
|
||||
|
||||
canModifyCard() {
|
||||
return (
|
||||
Meteor.user() &&
|
||||
Meteor.user().isBoardMember() &&
|
||||
!Meteor.user().isCommentOnly() &&
|
||||
!Meteor.user().isWorker()
|
||||
);
|
||||
},
|
||||
|
||||
deleteSubtask() {
|
||||
const subtask = this.currentData().subtask;
|
||||
if (subtask && subtask._id) {
|
||||
|
|
@ -117,17 +97,6 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('subtasks');
|
||||
|
||||
Template.subtaskItemDetail.helpers({
|
||||
canModifyCard() {
|
||||
return (
|
||||
Meteor.user() &&
|
||||
Meteor.user().isBoardMember() &&
|
||||
!Meteor.user().isCommentOnly() &&
|
||||
!Meteor.user().isWorker()
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
// ...
|
||||
}).register('subtaskItemDetail');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue