@vexcms/core 0.0.17 → 0.0.18
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 +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -358,7 +358,7 @@ function defineAccess(props) {
|
|
|
358
358
|
// src/access/hasPermission.ts
|
|
359
359
|
function resolvePermissionCheck(props) {
|
|
360
360
|
if (props.check === void 0) {
|
|
361
|
-
if (props.fields === void 0) return true;
|
|
361
|
+
if (props.fields === void 0 || props.fields.length === 0) return true;
|
|
362
362
|
return Object.fromEntries(props.fields.map((k) => [k, true]));
|
|
363
363
|
}
|
|
364
364
|
let resolved;
|
|
@@ -397,8 +397,10 @@ function mergeRolePermissions(props) {
|
|
|
397
397
|
if (props.fields === void 0) return true;
|
|
398
398
|
return Object.fromEntries(props.fields.map((k) => [k, true]));
|
|
399
399
|
}
|
|
400
|
-
if (props.fields === void 0) {
|
|
401
|
-
return props.results.some(
|
|
400
|
+
if (props.fields === void 0 || props.fields.length === 0) {
|
|
401
|
+
return props.results.some(
|
|
402
|
+
(r) => typeof r === "boolean" ? r : Object.values(r).some(Boolean)
|
|
403
|
+
);
|
|
402
404
|
}
|
|
403
405
|
return Object.fromEntries(
|
|
404
406
|
props.fields.map((k) => [
|