grm-shared-library 1.0.62 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/role/data/roles.data.js +27 -0
- package/dist/modules/role/enums/role.enum.d.ts +2 -1
- package/dist/modules/role/enums/role.enum.js +2 -1
- package/dist/modules/user/dtos/create-user.dto.d.ts +2 -1
- package/dist/modules/user/dtos/create-user.dto.js +4 -3
- package/dist/modules/user/interfaces/user.d.ts +2 -2
- package/package.json +1 -1
|
@@ -9,6 +9,33 @@ exports.ROLES_DATA = [
|
|
|
9
9
|
description: 'Super Admin',
|
|
10
10
|
permissions: ['*']
|
|
11
11
|
},
|
|
12
|
+
{
|
|
13
|
+
name: role_enum_1.Roles.ORGANIZATION_OWNER,
|
|
14
|
+
description: 'Organization Owner: Manages all Organization functions',
|
|
15
|
+
permissions: [
|
|
16
|
+
//organization
|
|
17
|
+
permission_1.PermissionActions.READ_ORGANIZATION,
|
|
18
|
+
permission_1.PermissionActions.UPDATE_ORGANIZATION,
|
|
19
|
+
permission_1.PermissionActions.DELETE_ORGANIZATION,
|
|
20
|
+
//control centre
|
|
21
|
+
permission_1.PermissionActions.CREATE_CONTROL_CENTRE,
|
|
22
|
+
permission_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
23
|
+
permission_1.PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
24
|
+
permission_1.PermissionActions.DELETE_CONTROL_CENTRE,
|
|
25
|
+
//Role
|
|
26
|
+
permission_1.PermissionActions.READ_ROLE,
|
|
27
|
+
//User
|
|
28
|
+
permission_1.PermissionActions.CREATE_USER,
|
|
29
|
+
permission_1.PermissionActions.READ_USER,
|
|
30
|
+
permission_1.PermissionActions.UPDATE_USER,
|
|
31
|
+
permission_1.PermissionActions.DELETE_USER,
|
|
32
|
+
//Incident
|
|
33
|
+
permission_1.PermissionActions.CREATE_INCIDENT,
|
|
34
|
+
permission_1.PermissionActions.READ_INCIDENT,
|
|
35
|
+
permission_1.PermissionActions.UPDATE_INCIDENT,
|
|
36
|
+
permission_1.PermissionActions.DELETE_INCIDENT
|
|
37
|
+
]
|
|
38
|
+
},
|
|
12
39
|
{
|
|
13
40
|
name: role_enum_1.Roles.ORGANIZATION_ADMIN,
|
|
14
41
|
description: 'Organization Admin: Manage Organization & Set up Control Centres',
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Roles = void 0;
|
|
4
4
|
var Roles;
|
|
5
5
|
(function (Roles) {
|
|
6
|
-
Roles["SUPER_ADMIN"] = "Super
|
|
6
|
+
Roles["SUPER_ADMIN"] = "Super-Admin";
|
|
7
|
+
Roles["ORGANIZATION_OWNER"] = "Org:Owner";
|
|
7
8
|
Roles["ORGANIZATION_ADMIN"] = "Org:Admin";
|
|
8
9
|
Roles["ORGANIZATION_USER"] = "Org:User";
|
|
9
10
|
Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { UserStatus } from '../enums/user-status.enum';
|
|
2
|
+
import { Roles } from '../../role';
|
|
2
3
|
export declare class CreateUserDto {
|
|
3
4
|
name: string;
|
|
4
5
|
email: string;
|
|
5
6
|
phoneNumber?: string;
|
|
6
|
-
|
|
7
|
+
roles: Roles[];
|
|
7
8
|
password?: string;
|
|
8
9
|
avatar?: string;
|
|
9
10
|
designation?: string;
|
|
@@ -14,6 +14,7 @@ const class_validator_1 = require("class-validator");
|
|
|
14
14
|
const case_decorators_1 = require("../../../decorators/case-decorators");
|
|
15
15
|
const user_status_enum_1 = require("../enums/user-status.enum");
|
|
16
16
|
const password_regex_const_1 = require("../../common/constants/password-regex.const");
|
|
17
|
+
const role_1 = require("../../role");
|
|
17
18
|
class CreateUserDto {
|
|
18
19
|
}
|
|
19
20
|
exports.CreateUserDto = CreateUserDto;
|
|
@@ -39,10 +40,10 @@ __decorate([
|
|
|
39
40
|
], CreateUserDto.prototype, "phoneNumber", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
(0, class_validator_1.IsArray)(),
|
|
42
|
-
(0, class_validator_1.
|
|
43
|
-
(0, class_validator_1.
|
|
43
|
+
(0, class_validator_1.IsEnum)(role_1.Roles, { each: true }),
|
|
44
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
44
45
|
__metadata("design:type", Array)
|
|
45
|
-
], CreateUserDto.prototype, "
|
|
46
|
+
], CreateUserDto.prototype, "roles", void 0);
|
|
46
47
|
__decorate([
|
|
47
48
|
(0, class_validator_1.IsString)(),
|
|
48
49
|
(0, class_validator_1.MinLength)(8),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ControlCentre } from "../../control-centre";
|
|
2
2
|
import { Organization } from "../../organization";
|
|
3
|
-
import {
|
|
3
|
+
import { Roles } from "../../role";
|
|
4
4
|
export interface User {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
7
|
email: string;
|
|
8
8
|
phoneNumber?: string;
|
|
9
|
-
roles:
|
|
9
|
+
roles: Roles[];
|
|
10
10
|
password?: string;
|
|
11
11
|
avatar?: string;
|
|
12
12
|
designation?: string;
|