utopia-ui 3.0.3 → 3.0.4
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 +11 -7
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3081,20 +3081,24 @@ function usePermissionsManager(initialPermissions) {
|
|
3081
3081
|
: evaluateCondition(andCondition);
|
3082
3082
|
});
|
3083
3083
|
};
|
3084
|
-
|
3084
|
+
// Bedingung für leere Berechtigungen nur, wenn NICHT item und create
|
3085
|
+
if (permissions.length === 0 && !(collectionName === "item" && action === "create"))
|
3085
3086
|
return true;
|
3086
|
-
else if (user && user.role === adminRole)
|
3087
|
+
else if (user && user.role.id === adminRole)
|
3087
3088
|
return true;
|
3088
3089
|
else {
|
3089
3090
|
return permissions.some(function (p) {
|
3090
3091
|
var _a;
|
3091
3092
|
return p.action === action &&
|
3092
3093
|
p.collection === collectionName &&
|
3093
|
-
(
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3094
|
+
(
|
3095
|
+
// Neue Bedingung für "item" und "create"
|
3096
|
+
(collectionName === "item" && action === "create" && (layer === null || layer === void 0 ? void 0 : layer.public_edit_items) === true) ||
|
3097
|
+
((p.policy.name === (user === null || user === void 0 ? void 0 : user.role.name) &&
|
3098
|
+
(!item || evaluatePermissions(p.permissions))) ||
|
3099
|
+
(p.policy == null &&
|
3100
|
+
(((layer === null || layer === void 0 ? void 0 : layer.public_edit_items) || ((_a = item === null || item === void 0 ? void 0 : item.layer) === null || _a === void 0 ? void 0 : _a.public_edit_items)) &&
|
3101
|
+
(!item || evaluatePermissions(p.permissions))))));
|
3098
3102
|
});
|
3099
3103
|
}
|
3100
3104
|
}, [permissions, user]);
|