mirror of
https://github.com/wekan/wekan.git
synced 2026-01-22 01:06:09 +01:00
Utils of canModifyCard and canModifyBoard + move this general functions to Utils class
This commit is contained in:
parent
b29ec93c34
commit
583f114c68
10 changed files with 28 additions and 135 deletions
|
|
@ -212,18 +212,10 @@ BlazeComponent.extendComponent({
|
|||
);
|
||||
});
|
||||
|
||||
function userIsMember() {
|
||||
return (
|
||||
Meteor.user() &&
|
||||
Meteor.user().isBoardMember() &&
|
||||
!Meteor.user().isCommentOnly()
|
||||
);
|
||||
}
|
||||
|
||||
// If there is no data in the board (ie, no lists) we autofocus the list
|
||||
// creation form by clicking on the corresponding element.
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
if (userIsMember() && currentBoard.lists().count() === 0) {
|
||||
if (Utils.canModifyBoard() && currentBoard.lists().count() === 0) {
|
||||
boardComponent.openNewListForm();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue