diff options
author | Ryan Helsing <ryanhelsing@gmail.com> | 2017-03-18 14:59:28 -0400 |
---|---|---|
committer | Ryan Helsing <ryanhelsing@gmail.com> | 2017-03-18 14:59:28 -0400 |
commit | e6276271b1a49bb705ef8777150634c8704bdc9b (patch) | |
tree | fd9b8bee05ca464bc50cf76b8ca319700f345888 /models | |
parent | 4a0474dfc3ce2dcb0c6de21163879d7cf3084a35 (diff) | |
download | wekan-e6276271b1a49bb705ef8777150634c8704bdc9b.tar.gz wekan-e6276271b1a49bb705ef8777150634c8704bdc9b.tar.bz2 wekan-e6276271b1a49bb705ef8777150634c8704bdc9b.zip |
ability to store comment only, actual prevention next
Diffstat (limited to 'models')
-rw-r--r-- | models/boards.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/models/boards.js b/models/boards.js index 9323d690..4492d299 100644 --- a/models/boards.js +++ b/models/boards.js @@ -107,6 +107,7 @@ Boards.attachSchema(new SimpleSchema({ userId: this.userId, isAdmin: true, isActive: true, + isCommentOnly: false, }]; } }, @@ -120,6 +121,9 @@ Boards.attachSchema(new SimpleSchema({ 'members.$.isActive': { type: Boolean, }, + 'members.$.isCommentOnly': { + type: Boolean, + }, permission: { type: String, allowedValues: ['public', 'private'], @@ -219,6 +223,10 @@ Boards.helpers({ return !!_.findWhere(this.members, {userId: memberId, isActive: true, isAdmin: true}); }, + hasCommentOnly(memberId) { + return !!_.findWhere(this.members, {userId: memberId, isActive: true, isAdmin: false, isCommentOnly: true}); + }, + absoluteUrl() { return FlowRouter.url('board', { id: this._id, slug: this.slug }); }, @@ -332,7 +340,7 @@ Boards.mutations({ }; }, - setMemberPermission(memberId, isAdmin) { + setMemberPermission(memberId, isAdmin, isCommentOnly) { const memberIndex = this.memberIndex(memberId); // do not allow change permission of self @@ -343,6 +351,7 @@ Boards.mutations({ return { $set: { [`members.${memberIndex}.isAdmin`]: isAdmin, + [`members.${memberIndex}.isCommentOnly`]: isCommentOnly, }, }; }, |