@dnax/core 0.13.1 → 0.13.3
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/permissions.ts +8 -3
- package/package.json +1 -1
package/lib/permissions.ts
CHANGED
|
@@ -61,16 +61,21 @@ function checkPermission(
|
|
|
61
61
|
|
|
62
62
|
// 1- Check if all connection
|
|
63
63
|
let findAsterixCollection = perm?.access?.find((c) =>
|
|
64
|
-
c
|
|
64
|
+
c?.collections?.includes("*")
|
|
65
65
|
);
|
|
66
|
+
|
|
66
67
|
if (findAsterixCollection) {
|
|
67
|
-
|
|
68
|
+
// super root actions all All
|
|
69
|
+
let actionsOnAll = findAsterixCollection.actions.find(
|
|
70
|
+
(a) => a === action || a === "allAction" || a === "*"
|
|
71
|
+
);
|
|
68
72
|
actionsOnAll ? (approved = true) : (approved = false);
|
|
73
|
+
if (approved) return true;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
// 2- Check if collection and action
|
|
72
77
|
let findCollection = perm?.access?.find((c) =>
|
|
73
|
-
c
|
|
78
|
+
c?.collections?.includes(collection)
|
|
74
79
|
);
|
|
75
80
|
if (findCollection) {
|
|
76
81
|
let actionsOnCollection = findCollection.actions.find((a) => a === action);
|