mirror of
https://github.com/wekan/wekan.git
synced 2026-02-04 23:51:48 +01:00
ability to store comment only, actual prevention next
This commit is contained in:
parent
4a0474dfc3
commit
e6276271b1
4 changed files with 44 additions and 7 deletions
|
|
@ -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,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue