diff options
author | Ryan Helsing <ryanhelsing@gmail.com> | 2017-03-18 18:49:39 -0400 |
---|---|---|
committer | Ryan Helsing <ryanhelsing@gmail.com> | 2017-03-18 18:49:39 -0400 |
commit | de10be6a21679ad6ea3a6d97506f84d32cc72d26 (patch) | |
tree | 1c34b9656a7df29857ca079cdd105585d9f61538 /models | |
parent | ec9498fa627228bd411af6070645fa2ed7cd895d (diff) | |
download | wekan-de10be6a21679ad6ea3a6d97506f84d32cc72d26.tar.gz wekan-de10be6a21679ad6ea3a6d97506f84d32cc72d26.tar.bz2 wekan-de10be6a21679ad6ea3a6d97506f84d32cc72d26.zip |
comment only working, naive implementation complete
Diffstat (limited to 'models')
-rw-r--r-- | models/lists.js | 6 | ||||
-rw-r--r-- | models/users.js | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/models/lists.js b/models/lists.js index 682fb096..0ae3ca5f 100644 --- a/models/lists.js +++ b/models/lists.js @@ -46,13 +46,13 @@ Lists.attachSchema(new SimpleSchema({ Lists.allow({ insert(userId, doc) { - return allowIsBoardMember(userId, Boards.findOne(doc.boardId)); + return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId)); }, update(userId, doc) { - return allowIsBoardMember(userId, Boards.findOne(doc.boardId)); + return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId)); }, remove(userId, doc) { - return allowIsBoardMember(userId, Boards.findOne(doc.boardId)); + return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId)); }, fetch: ['boardId'], }); diff --git a/models/users.js b/models/users.js index 3073e759..f062df9d 100644 --- a/models/users.js +++ b/models/users.js @@ -117,6 +117,11 @@ if (Meteor.isClient) { return board && board.hasMember(this._id); }, + isNotCommentOnly() { + const board = Boards.findOne(Session.get('currentBoard')); + return board && board.hasMember(this._id) && !board.hasCommentOnly(this._id); + }, + isCommentOnly() { const board = Boards.findOne(Session.get('currentBoard')); return board && board.hasCommentOnly(this._id); |