diff options
author | Ymeramees <ymeramees@servu> | 2018-09-05 07:23:34 +0300 |
---|---|---|
committer | Ymeramees <ymeramees@servu> | 2018-09-05 07:23:34 +0300 |
commit | 6c0b6ca6702b7f605b43eee8579ce1181f59f09e (patch) | |
tree | f282393c57a1b776425dab08e9214538257672a7 /models/boards.js | |
parent | 1298a07838fb748285bc298b7d8b186dce5fb399 (diff) | |
parent | 9492daf9bcaade700eb00b11f0d7a969fb66a4bf (diff) | |
download | wekan-6c0b6ca6702b7f605b43eee8579ce1181f59f09e.tar.gz wekan-6c0b6ca6702b7f605b43eee8579ce1181f59f09e.tar.bz2 wekan-6c0b6ca6702b7f605b43eee8579ce1181f59f09e.zip |
Merge remote-tracking branch 'upstream/master' into devel
Merge to update to latest upstream/master
Diffstat (limited to 'models/boards.js')
-rw-r--r-- | models/boards.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/models/boards.js b/models/boards.js index a017eb3f..71049bd9 100644 --- a/models/boards.js +++ b/models/boards.js @@ -110,6 +110,7 @@ Boards.attachSchema(new SimpleSchema({ userId: this.userId, isAdmin: true, isActive: true, + isNoComments: false, isCommentOnly: false, }]; } @@ -124,6 +125,9 @@ Boards.attachSchema(new SimpleSchema({ 'members.$.isActive': { type: Boolean, }, + 'members.$.isNoComments': { + type: Boolean, + }, 'members.$.isCommentOnly': { type: Boolean, }, @@ -292,6 +296,10 @@ Boards.helpers({ return !!_.findWhere(this.members, { userId: memberId, isActive: true, isAdmin: true }); }, + hasNoComments(memberId) { + return !!_.findWhere(this.members, { userId: memberId, isActive: true, isAdmin: false, isNoComments: true }); + }, + hasCommentOnly(memberId) { return !!_.findWhere(this.members, { userId: memberId, isActive: true, isAdmin: false, isCommentOnly: true }); }, @@ -501,6 +509,7 @@ Boards.mutations({ userId: memberId, isAdmin: false, isActive: true, + isNoComments: false, isCommentOnly: false, }, }, @@ -528,7 +537,7 @@ Boards.mutations({ }; }, - setMemberPermission(memberId, isAdmin, isCommentOnly) { + setMemberPermission(memberId, isAdmin, isNoComments, isCommentOnly) { const memberIndex = this.memberIndex(memberId); // do not allow change permission of self @@ -539,6 +548,7 @@ Boards.mutations({ return { $set: { [`members.${memberIndex}.isAdmin`]: isAdmin, + [`members.${memberIndex}.isNoComments`]: isNoComments, [`members.${memberIndex}.isCommentOnly`]: isCommentOnly, }, }; @@ -838,6 +848,7 @@ if (Meteor.isServer) { userId: req.body.owner, isAdmin: true, isActive: true, + isNoComments: false, isCommentOnly: false, }, ], |