mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
bugfix: only care active members, also optimize some code
This commit is contained in:
parent
b719968df5
commit
672c21bfe0
9 changed files with 62 additions and 78 deletions
|
|
@ -1,8 +1,7 @@
|
|||
allowIsBoardAdmin = function(userId, board) {
|
||||
const admins = _.pluck(_.where(board.members, {isAdmin: true}), 'userId');
|
||||
return _.contains(admins, userId);
|
||||
return board && board.hasAdmin(userId);
|
||||
};
|
||||
|
||||
allowIsBoardMember = function(userId, board) {
|
||||
return _.contains(_.pluck(board.members, 'userId'), userId);
|
||||
return board && board.hasMember(userId);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue