@clownlee/cores 1.0.6 → 1.0.7
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/index.js +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -943,17 +943,18 @@ function usePermissionCheck(permission, logic = "OR", matchMode = "exact", permi
|
|
|
943
943
|
try {
|
|
944
944
|
const store = permissionStore;
|
|
945
945
|
let permissions = [];
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
const storeValue = (store == null ? void 0 : store.value) !== void 0 ? store.value : store;
|
|
947
|
+
if (storeValue[permissionKey]) {
|
|
948
|
+
const value = storeValue[permissionKey];
|
|
948
949
|
permissions = Array.isArray(value == null ? void 0 : value.value) ? value.value : Array.isArray(value) ? value : [];
|
|
949
|
-
} else if (
|
|
950
|
-
const value =
|
|
950
|
+
} else if (storeValue.$state && storeValue.$state[permissionKey]) {
|
|
951
|
+
const value = storeValue.$state[permissionKey];
|
|
951
952
|
permissions = Array.isArray(value) ? value : [];
|
|
952
|
-
} else if (
|
|
953
|
-
const value =
|
|
953
|
+
} else if (storeValue.state && storeValue.state[permissionKey]) {
|
|
954
|
+
const value = storeValue.state[permissionKey];
|
|
954
955
|
permissions = Array.isArray(value) ? value : [];
|
|
955
|
-
} else if (
|
|
956
|
-
const value =
|
|
956
|
+
} else if (storeValue.permissions) {
|
|
957
|
+
const value = storeValue.permissions;
|
|
957
958
|
permissions = Array.isArray(value == null ? void 0 : value.value) ? value.value : Array.isArray(value) ? value : [];
|
|
958
959
|
}
|
|
959
960
|
permissions = flattenPermissions(permissions);
|