Add isAnyAdmin method to user model
This commit is contained in:
parent
5e83436e15
commit
f5fc653fff
@ -17,5 +17,9 @@ export class User {
|
||||
isBoardAdmin() {
|
||||
return this.security_level === 2;
|
||||
}
|
||||
|
||||
isAnyAdmin() {
|
||||
return this.security_level === 1 || this.security_level === 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,5 +52,10 @@ describe('User', () => {
|
||||
expect(user.isBoardAdmin).to.be.a('function');
|
||||
expect(user.isBoardAdmin()).to.equal(false);
|
||||
});
|
||||
|
||||
it('has a method to check for any admin', () => {
|
||||
expect(user.isAnyAdmin).to.be.a('function');
|
||||
expect(user.isAnyAdmin()).to.equal(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user