summaryrefslogtreecommitdiffstats
path: root/models/users.js
diff options
context:
space:
mode:
authorXavier Priour <xavier.priour@bubblyware.com>2015-12-13 20:02:51 +0100
committerXavier Priour <xavier.priour@bubblyware.com>2015-12-13 20:02:51 +0100
commite304185c23014fe3a4511d213535549e4bfeb207 (patch)
tree1e3a33f06db36b52f9bbfafb6163a652883a0cdf /models/users.js
parent18697d45f652a119ba21b0cef42fbf732902bfa9 (diff)
parent0954cff5b470712210275a9c0699d85d6579ab54 (diff)
downloadwekan-e304185c23014fe3a4511d213535549e4bfeb207.tar.gz
wekan-e304185c23014fe3a4511d213535549e4bfeb207.tar.bz2
wekan-e304185c23014fe3a4511d213535549e4bfeb207.zip
Merge remote-tracking branch 'upstream/devel' into devel
Diffstat (limited to 'models/users.js')
-rw-r--r--models/users.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/models/users.js b/models/users.js
index 2c9ae380..cf4c4193 100644
--- a/models/users.js
+++ b/models/users.js
@@ -12,16 +12,12 @@ if (Meteor.isClient) {
Users.helpers({
isBoardMember() {
const board = Boards.findOne(Session.get('currentBoard'));
- return board &&
- _.contains(_.pluck(board.members, 'userId'), this._id) &&
- _.where(board.members, {userId: this._id})[0].isActive;
+ return board && board.hasMember(this._id);
},
isBoardAdmin() {
const board = Boards.findOne(Session.get('currentBoard'));
- return board &&
- this.isBoardMember(board) &&
- _.where(board.members, {userId: this._id})[0].isAdmin;
+ return board && board.hasAdmin(this._id);
},
});
}