Add isAnyAdmin method to user model

This commit is contained in:
kiswa 2017-07-31 21:20:10 +00:00
parent 5e83436e15
commit f5fc653fff
2 changed files with 9 additions and 0 deletions

View File

@ -17,5 +17,9 @@ export class User {
isBoardAdmin() {
return this.security_level === 2;
}
isAnyAdmin() {
return this.security_level === 1 || this.security_level === 2;
}
}

View File

@ -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);
});
});