@edular/permissions 9.2.1 → 9.4.0
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/lib/constants.d.ts +7 -7
- package/lib/helpers.js +1 -1
- package/lib/index.js +1 -5
- package/lib/permissions.d.ts +19 -0
- package/lib/permissions.js +19 -0
- package/package.json +5 -5
package/lib/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare enum UserProfileType {
|
|
|
5
5
|
Student = "student",
|
|
6
6
|
Others = "others"
|
|
7
7
|
}
|
|
8
|
-
export type PermissionDetails = {
|
|
8
|
+
export declare type PermissionDetails = {
|
|
9
9
|
permissionId: number;
|
|
10
10
|
name: string;
|
|
11
11
|
departmentId?: number;
|
|
@@ -45,27 +45,27 @@ export declare const SubunitPermissionTargetTypes: {
|
|
|
45
45
|
"tasks.reopen_completed": PermissionType[];
|
|
46
46
|
director: PermissionType[];
|
|
47
47
|
};
|
|
48
|
-
export type StaffProfilePermissionsDetails = {
|
|
48
|
+
export declare type StaffProfilePermissionsDetails = {
|
|
49
49
|
type: UserProfileType.Staff;
|
|
50
50
|
enabledPermissionIds: number[];
|
|
51
51
|
enabledDepartmentPermissionIds: number[];
|
|
52
52
|
isUserAccessDisabled: boolean;
|
|
53
53
|
isPersonalContactsAccessDisabled: boolean;
|
|
54
54
|
};
|
|
55
|
-
export type StudentProfilePermissionsDetails = {
|
|
55
|
+
export declare type StudentProfilePermissionsDetails = {
|
|
56
56
|
type: UserProfileType.Student;
|
|
57
57
|
enabledPermissionIds: number[];
|
|
58
58
|
isUserAccessDisabled: boolean;
|
|
59
59
|
isPersonalContactsAccessDisabled: boolean;
|
|
60
60
|
};
|
|
61
|
-
export type AdminProfilePermissionsDetails = {
|
|
61
|
+
export declare type AdminProfilePermissionsDetails = {
|
|
62
62
|
type: UserProfileType.Admin;
|
|
63
63
|
};
|
|
64
|
-
export type ApiKeyProfilePermissionsDetails = {
|
|
64
|
+
export declare type ApiKeyProfilePermissionsDetails = {
|
|
65
65
|
type: UserProfileType.ApiKey;
|
|
66
66
|
};
|
|
67
|
-
export type OthersProfilePermissionsDetails = {
|
|
67
|
+
export declare type OthersProfilePermissionsDetails = {
|
|
68
68
|
type: UserProfileType.Others;
|
|
69
69
|
enabledPermissionIds: number[];
|
|
70
70
|
};
|
|
71
|
-
export type ProfilePermissionsDetails = StaffProfilePermissionsDetails | StudentProfilePermissionsDetails | AdminProfilePermissionsDetails | ApiKeyProfilePermissionsDetails | OthersProfilePermissionsDetails;
|
|
71
|
+
export declare type ProfilePermissionsDetails = StaffProfilePermissionsDetails | StudentProfilePermissionsDetails | AdminProfilePermissionsDetails | ApiKeyProfilePermissionsDetails | OthersProfilePermissionsDetails;
|
package/lib/helpers.js
CHANGED
|
@@ -18,7 +18,7 @@ var checkIfProfileHasNeededPermissions = function (profilePermissions, permissio
|
|
|
18
18
|
exports.checkIfProfileHasNeededPermissions = checkIfProfileHasNeededPermissions;
|
|
19
19
|
var getEnabledPermissionsForTarget = function (permissions, target, type) {
|
|
20
20
|
return permissions.filter(function (permission) {
|
|
21
|
-
return permission.name.endsWith(
|
|
21
|
+
return permission.name.endsWith(target + "." + type);
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
exports.getEnabledPermissionsForTarget = getEnabledPermissionsForTarget;
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
5
|
}) : (function(o, m, k, k2) {
|
|
10
6
|
if (k2 === undefined) k2 = k;
|
|
11
7
|
o[k2] = m[k];
|
package/lib/permissions.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export declare const Permissions: {
|
|
|
21
21
|
Edit: number;
|
|
22
22
|
Delete: number;
|
|
23
23
|
};
|
|
24
|
+
LessonDetails: {
|
|
25
|
+
Add: number;
|
|
26
|
+
Edit: number;
|
|
27
|
+
Delete: number;
|
|
28
|
+
};
|
|
24
29
|
};
|
|
25
30
|
AttendanceOverview: {
|
|
26
31
|
View: number;
|
|
@@ -671,6 +676,20 @@ export declare const Permissions: {
|
|
|
671
676
|
AcademicProgress: {
|
|
672
677
|
View: number;
|
|
673
678
|
};
|
|
679
|
+
StatusesOf: {
|
|
680
|
+
Prospect: {
|
|
681
|
+
Edit: number;
|
|
682
|
+
};
|
|
683
|
+
Applicant: {
|
|
684
|
+
Edit: number;
|
|
685
|
+
};
|
|
686
|
+
Student: {
|
|
687
|
+
Edit: number;
|
|
688
|
+
};
|
|
689
|
+
Alumni: {
|
|
690
|
+
Edit: number;
|
|
691
|
+
};
|
|
692
|
+
};
|
|
674
693
|
ActivityLogs: {
|
|
675
694
|
View: number;
|
|
676
695
|
};
|
package/lib/permissions.js
CHANGED
|
@@ -23,6 +23,11 @@ exports.Permissions = {
|
|
|
23
23
|
Add: 1132,
|
|
24
24
|
Edit: 1133,
|
|
25
25
|
Delete: 1134
|
|
26
|
+
},
|
|
27
|
+
LessonDetails: {
|
|
28
|
+
Add: 6132,
|
|
29
|
+
Edit: 6133,
|
|
30
|
+
Delete: 6134
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
33
|
AttendanceOverview: {
|
|
@@ -674,6 +679,20 @@ exports.Permissions = {
|
|
|
674
679
|
AcademicProgress: {
|
|
675
680
|
View: 6109
|
|
676
681
|
},
|
|
682
|
+
StatusesOf: {
|
|
683
|
+
Prospect: {
|
|
684
|
+
Edit: 6126
|
|
685
|
+
},
|
|
686
|
+
Applicant: {
|
|
687
|
+
Edit: 6127
|
|
688
|
+
},
|
|
689
|
+
Student: {
|
|
690
|
+
Edit: 6128
|
|
691
|
+
},
|
|
692
|
+
Alumni: {
|
|
693
|
+
Edit: 6129
|
|
694
|
+
}
|
|
695
|
+
},
|
|
677
696
|
ActivityLogs: {
|
|
678
697
|
View: 6131
|
|
679
698
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edular/permissions",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"author": "Edular",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"ts-node": "^10.2.1",
|
|
18
18
|
"typescript": "^4.4.2"
|
|
19
19
|
},
|
|
20
|
-
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
22
|
-
},
|
|
23
20
|
"scripts": {
|
|
24
21
|
"build": "tsc",
|
|
25
22
|
"build:clean": "rm -rf lib",
|
|
26
23
|
"generate-permissions": "ts-node scripts/generate-permissions.ts",
|
|
27
24
|
"prepublish": "yarn build:clean && yarn build"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|