@nocobase/acl 1.6.0-alpha.1 → 1.6.0-alpha.10
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/acl.js +15 -0
- package/package.json +4 -4
package/lib/acl.js
CHANGED
|
@@ -360,6 +360,18 @@ const _ACL = class _ACL extends import_events.default {
|
|
|
360
360
|
ctx.permission.parsedParams = parsedParams;
|
|
361
361
|
((_d = ctx.log) == null ? void 0 : _d.debug) && ctx.log.debug("acl parsedParams", parsedParams);
|
|
362
362
|
ctx.permission.rawParams = import_lodash.default.cloneDeep(resourcerAction.params);
|
|
363
|
+
if (parsedParams.appends && resourcerAction.params.fields) {
|
|
364
|
+
for (const queryField of resourcerAction.params.fields) {
|
|
365
|
+
if (parsedParams.appends.indexOf(queryField) !== -1) {
|
|
366
|
+
if (!resourcerAction.params.appends) {
|
|
367
|
+
resourcerAction.params.appends = [];
|
|
368
|
+
}
|
|
369
|
+
resourcerAction.params.appends.push(queryField);
|
|
370
|
+
resourcerAction.params.fields = resourcerAction.params.fields.filter((f) => f !== queryField);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const isEmptyFields = resourcerAction.params.fields && resourcerAction.params.fields.length === 0;
|
|
363
375
|
resourcerAction.mergeParams(parsedParams, {
|
|
364
376
|
appends: /* @__PURE__ */ __name((x, y) => {
|
|
365
377
|
if (!x) {
|
|
@@ -371,6 +383,9 @@ const _ACL = class _ACL extends import_events.default {
|
|
|
371
383
|
return x.filter((i) => y.includes(i.split(".").shift()));
|
|
372
384
|
}, "appends")
|
|
373
385
|
});
|
|
386
|
+
if (isEmptyFields) {
|
|
387
|
+
resourcerAction.params.fields = [];
|
|
388
|
+
}
|
|
374
389
|
ctx.permission.mergedParams = import_lodash.default.cloneDeep(resourcerAction.params);
|
|
375
390
|
}
|
|
376
391
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/acl",
|
|
3
|
-
"version": "1.6.0-alpha.
|
|
3
|
+
"version": "1.6.0-alpha.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/resourcer": "1.6.0-alpha.
|
|
10
|
-
"@nocobase/utils": "1.6.0-alpha.
|
|
9
|
+
"@nocobase/resourcer": "1.6.0-alpha.10",
|
|
10
|
+
"@nocobase/utils": "1.6.0-alpha.10",
|
|
11
11
|
"minimatch": "^5.1.1"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
16
16
|
"directory": "packages/acl"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "8ba8204282be7bf6674ef427fdbe31caa65977d5"
|
|
19
19
|
}
|