forked from nuagenetworks/js-bambou
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserRole.js
61 lines (49 loc) · 1.09 KB
/
UserRole.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { Enum } from 'enumify';
class UserRole extends Enum {
_hasRole(role) {
return this === role;
}
hasRoot() {
return this._hasRole(UserRole.CSPROOT);
}
hasAuditAdmin() {
return this._hasRole(UserRole.AUDITADMIN);
}
hasAdmin() {
return this._hasRole(UserRole.ORGADMIN);
}
hasAdminOperator () {
return this._hasRole(UserRole.ADMINOPERATOR);
}
hasNetworkDesigner() {
return this._hasRole(UserRole.ORGNETWORKDESIGNER);
}
hasOperator() {
return this._hasRole(UserRole.CSPOPERATOR);
}
hasSecurityAdmin() {
return this._hasRole(UserRole.SECURITYADMINISTRATOR);
}
hasSystem() {
return this._hasRole(UserRole.SYSTEM);
}
hasOrguser() {
return this._hasRole(UserRole.ORGUSER);
}
}
UserRole.initEnum([
'SYSTEM',
'JMS',
'CSPROOT',
'CMS',
'CSPOPERATOR',
'AUDITADMIN',
'ORGADMIN',
'ORGNETWORKDESIGNER',
'SECURITYADMINISTRATOR',
'ADMINOPERATOR',
'ORGUSER',
'USER',
'UNKNOWN'
]);
export default UserRole;