@edular/permissions 12.9.1 → 12.10.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/README.md +0 -0
- package/lib/constants.d.ts +7 -7
- package/lib/helpers.js +1 -1
- package/lib/index.js +1 -5
- package/lib/permissions.d.ts +8 -0
- package/lib/permissions.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
File without changes
|
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
|
@@ -1093,6 +1093,10 @@ export declare const Permissions: {
|
|
|
1093
1093
|
Edit: number;
|
|
1094
1094
|
Delete: number;
|
|
1095
1095
|
};
|
|
1096
|
+
ProfilePhoto: {
|
|
1097
|
+
View: number;
|
|
1098
|
+
Edit: number;
|
|
1099
|
+
};
|
|
1096
1100
|
};
|
|
1097
1101
|
Profile: {
|
|
1098
1102
|
View: number;
|
|
@@ -1256,6 +1260,10 @@ export declare const Permissions: {
|
|
|
1256
1260
|
Edit: number;
|
|
1257
1261
|
Delete: number;
|
|
1258
1262
|
};
|
|
1263
|
+
ProfilePhoto: {
|
|
1264
|
+
View: number;
|
|
1265
|
+
Edit: number;
|
|
1266
|
+
};
|
|
1259
1267
|
};
|
|
1260
1268
|
Profile: {
|
|
1261
1269
|
View: number;
|
package/lib/permissions.js
CHANGED
|
@@ -1095,6 +1095,10 @@ exports.Permissions = {
|
|
|
1095
1095
|
Add: 5272,
|
|
1096
1096
|
Edit: 5273,
|
|
1097
1097
|
Delete: 5274
|
|
1098
|
+
},
|
|
1099
|
+
ProfilePhoto: {
|
|
1100
|
+
View: 6187,
|
|
1101
|
+
Edit: 6188
|
|
1098
1102
|
}
|
|
1099
1103
|
},
|
|
1100
1104
|
Profile: {
|
|
@@ -1258,6 +1262,10 @@ exports.Permissions = {
|
|
|
1258
1262
|
Add: 5572,
|
|
1259
1263
|
Edit: 5573,
|
|
1260
1264
|
Delete: 5574
|
|
1265
|
+
},
|
|
1266
|
+
ProfilePhoto: {
|
|
1267
|
+
View: 6189,
|
|
1268
|
+
Edit: 6190
|
|
1261
1269
|
}
|
|
1262
1270
|
},
|
|
1263
1271
|
Profile: {
|