Fix getting permissions and active indicator

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-05-17 21:44:58 +02:00
parent 90eb9ce28e
commit 247b4dde0c
10 changed files with 62 additions and 20 deletions

View File

@@ -167,28 +167,31 @@ app.factory('BoardService', function(ApiService, $http, $q){
return false;
}
return this.getCurrent().permissions['PERMISSION_READ'];
}
};
BoardService.prototype.canEdit = function() {
if(!this.getCurrent() || !this.getCurrent().permissions) {
return false;
}
return this.getCurrent().permissions['PERMISSION_EDIT'];
}
};
BoardService.prototype.canManage = function() {
BoardService.prototype.canManage = function(board = null) {
if(board !== null) {
return board.permissions['PERMISSION_MANAGE'];
}
if(!this.getCurrent() || !this.getCurrent().permissions) {
return false;
}
return this.getCurrent().permissions['PERMISSION_MANAGE'];
}
};
BoardService.prototype.canShare = function() {
if(!this.getCurrent() || !this.getCurrent().permissions) {
return false;
}
return this.getCurrent().permissions['PERMISSION_SHARE'];
}
};
BoardService.prototype.isArchived = function () {
if(!this.getCurrent() || this.getCurrent().archived) {