@edular/permissions 9.2.1 → 9.3.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 +14 -0
- package/lib/permissions.js +14 -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
|
@@ -671,6 +671,20 @@ export declare const Permissions: {
|
|
|
671
671
|
AcademicProgress: {
|
|
672
672
|
View: number;
|
|
673
673
|
};
|
|
674
|
+
StatusesOf: {
|
|
675
|
+
Prospect: {
|
|
676
|
+
Edit: number;
|
|
677
|
+
};
|
|
678
|
+
Applicant: {
|
|
679
|
+
Edit: number;
|
|
680
|
+
};
|
|
681
|
+
Student: {
|
|
682
|
+
Edit: number;
|
|
683
|
+
};
|
|
684
|
+
Alumni: {
|
|
685
|
+
Edit: number;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
674
688
|
ActivityLogs: {
|
|
675
689
|
View: number;
|
|
676
690
|
};
|
package/lib/permissions.js
CHANGED
|
@@ -674,6 +674,20 @@ exports.Permissions = {
|
|
|
674
674
|
AcademicProgress: {
|
|
675
675
|
View: 6109
|
|
676
676
|
},
|
|
677
|
+
StatusesOf: {
|
|
678
|
+
Prospect: {
|
|
679
|
+
Edit: 6126
|
|
680
|
+
},
|
|
681
|
+
Applicant: {
|
|
682
|
+
Edit: 6127
|
|
683
|
+
},
|
|
684
|
+
Student: {
|
|
685
|
+
Edit: 6128
|
|
686
|
+
},
|
|
687
|
+
Alumni: {
|
|
688
|
+
Edit: 6129
|
|
689
|
+
}
|
|
690
|
+
},
|
|
677
691
|
ActivityLogs: {
|
|
678
692
|
View: 6131
|
|
679
693
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edular/permissions",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.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
|
+
}
|