forked from ratneshsinghparihar/Node-Data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
security-config.ts
48 lines (41 loc) · 1.22 KB
/
security-config.ts
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
export class SecurityConfig {
public static ResourceAccess: Array<{ name: string, acl: Array<{ role: string, accessmask: number, acl?: boolean }> }> = [{
"name": "blogs",
"acl": [{ "role": "ROLE_ADMIN", "accessmask": 7 },
{ "role": "ROLE_USER", "accessmask": 1 },
{ "role": "ROLE_AUTHOR", "accessmask": 7 }
]
},
{
"name": "comment",
"acl": [{ "role": "ROLE_ADMIN", "accessmask": 7 },
{ "role": "ROLE_USER", "accessmask": 7 },
{ "role": "ROLE_AUTHOR", "accessmask": 7 }
]
}];
public static tokenSecretkey: string = 'ericthered';
public static tokenExpiresInMinutes: number = 2;//2 months
public static issuer: string = "accounts.examplesoft.com";
public static audience: string = "yoursite.net";
}
export enum AccessMask {
view = 1,
edit = 2,
delete = 4,
approve = 8
};
export enum RoleEnum {
ROLE_ADMIN = 1,
ROLE_USER,
ROLE_AUTHOR,
ROLE_PUBLISHER
};
export enum AuthenticationType {
passwordBased = 1,
TokenBased = 2
};
export enum AuthenticationEnabled {
disabled = 1,
enabledWithoutAuthorization = 2,
enabledWithAuthorization = 3
};