@qlibs/utils 1.14.0 → 1.14.2
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/utils/auth.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare function removeUserData(): void;
|
|
|
7
7
|
export declare function saveMySubRoles(mySubRoles: object): void;
|
|
8
8
|
export declare function getMySubRoles(): any;
|
|
9
9
|
export declare function removeMySubRoles(): void;
|
|
10
|
-
export declare function checkIsMyMode(): boolean;
|
|
10
|
+
export declare function checkIsMyMode(mySubRolesData?: any): boolean;
|
package/dist/utils/auth.js
CHANGED
|
@@ -58,8 +58,8 @@ function getMySubRoles() {
|
|
|
58
58
|
function removeMySubRoles() {
|
|
59
59
|
return localStorage.removeItem(MY_SUB_ROLES);
|
|
60
60
|
}
|
|
61
|
-
function checkIsMyMode() {
|
|
62
|
-
const mySubRoles = getMySubRoles();
|
|
61
|
+
function checkIsMyMode(mySubRolesData) {
|
|
62
|
+
const mySubRoles = mySubRolesData ? mySubRolesData : getMySubRoles();
|
|
63
63
|
if (!mySubRoles) {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
@@ -2,21 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateArchivePermissions = generateArchivePermissions;
|
|
4
4
|
function generateArchivePermissions(feature) {
|
|
5
|
+
const features = Array.isArray(feature) ? feature : [feature];
|
|
5
6
|
return [
|
|
6
7
|
{
|
|
7
8
|
key: 'ARCHIVE',
|
|
8
9
|
checked: true,
|
|
9
|
-
permissions:
|
|
10
|
+
permissions: features.map((feature) => feature + '.ARCHIVE'),
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
key: 'RESTORE',
|
|
13
14
|
checked: true,
|
|
14
|
-
permissions:
|
|
15
|
+
permissions: features.map((feature) => feature + '.RESTORE'),
|
|
15
16
|
},
|
|
16
17
|
{
|
|
17
18
|
key: 'FORCE_DELETE',
|
|
18
19
|
checked: true,
|
|
19
|
-
permissions: [
|
|
20
|
+
permissions: [
|
|
21
|
+
...features.map((feature) => feature + '.DELETE'),
|
|
22
|
+
...features.map((feature) => feature + '.FORCE_DELETE'),
|
|
23
|
+
],
|
|
20
24
|
},
|
|
21
25
|
];
|
|
22
26
|
}
|