cant see add list if comment only

This commit is contained in:
Ryan Helsing 2017-03-18 15:22:40 -04:00
parent e6276271b1
commit 383daf6f64
3 changed files with 12 additions and 1 deletions

View file

@ -25,7 +25,7 @@ template(name="boardBody")
+list(this)
if currentCardIsInThisList
+cardDetails(currentCard)
if currentUser.isBoardMember
if canSeeAddList
+addListForm
template(name="addListForm")

View file

@ -204,3 +204,9 @@ BlazeComponent.extendComponent({
}];
},
}).register('addListForm');
Template.boardBody.helpers({
canSeeAddList() {
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
},
});

View file

@ -117,6 +117,11 @@ if (Meteor.isClient) {
return board && board.hasMember(this._id);
},
isCommentOnly() {
const board = Boards.findOne(Session.get('currentBoard'));
return board && board.hasCommentOnly(this._id);
},
isBoardAdmin() {
const board = Boards.findOne(Session.get('currentBoard'));
return board && board.hasAdmin(this._id);