utils.js 729 B

1234567891011121314151617181920212223242526
  1. allowIsBoardAdmin = function(userId, board) {
  2. return board && board.hasAdmin(userId);
  3. };
  4. allowIsBoardMember = function(userId, board) {
  5. return board && board.hasMember(userId);
  6. };
  7. allowIsAnyBoardMember = function(userId, boards) {
  8. return _.some(boards, board => {
  9. return board && board.hasMember(userId);
  10. });
  11. };
  12. allowIsBoardMemberCommentOnly = function(userId, board) {
  13. return board && board.hasMember(userId) && !board.hasCommentOnly(userId);
  14. };
  15. allowIsBoardMemberNoComments = function(userId, board) {
  16. return board && board.hasMember(userId) && !board.hasNoComments(userId);
  17. };
  18. allowIsBoardMemberByCard = function(userId, card) {
  19. const board = card.board();
  20. return board && board.hasMember(userId);
  21. };