@nocobase/plugin-acl 0.13.0-alpha.7 → 0.13.0-alpha.8
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/server/server.js +4 -3
- package/package.json +2 -2
package/dist/server/server.js
CHANGED
|
@@ -491,7 +491,7 @@ class PluginACL extends import_server.Plugin {
|
|
|
491
491
|
});
|
|
492
492
|
this.app.acl.use(
|
|
493
493
|
async (ctx, next) => {
|
|
494
|
-
var _a, _b, _c
|
|
494
|
+
var _a, _b, _c;
|
|
495
495
|
const { actionName, resourceName, resourceOf } = ctx.action;
|
|
496
496
|
if (resourceName.includes(".") && resourceOf) {
|
|
497
497
|
if (!((_b = (_a = ctx == null ? void 0 : ctx.permission) == null ? void 0 : _a.can) == null ? void 0 : _b.params)) {
|
|
@@ -508,10 +508,11 @@ class PluginACL extends import_server.Plugin {
|
|
|
508
508
|
ctx.permission.can = false;
|
|
509
509
|
}
|
|
510
510
|
} else {
|
|
511
|
-
const
|
|
511
|
+
const filteredParams = this.app.acl.filterParams(ctx, collectionName, (action == null ? void 0 : action.params) || {});
|
|
512
|
+
const params = await parseJsonTemplate(filteredParams, ctx);
|
|
512
513
|
const sourceInstance = await ctx.db.getRepository(collectionName).findOne({
|
|
513
514
|
filterByTk: resourceOf,
|
|
514
|
-
filter
|
|
515
|
+
filter: params.filter || {}
|
|
515
516
|
});
|
|
516
517
|
if (!sourceInstance) {
|
|
517
518
|
ctx.permission.can = false;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "权限控制",
|
|
5
5
|
"description": "A simple access control based on roles, resources and actions",
|
|
6
6
|
"description.zh-CN": "基于角色、资源和操作的权限控制。",
|
|
7
|
-
"version": "0.13.0-alpha.
|
|
7
|
+
"version": "0.13.0-alpha.8",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"devDependencies": {
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
29
29
|
"directory": "packages/plugins/acl"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "6c28d05da2fa88cf12473538a77dd4cce717f8f1"
|
|
32
32
|
}
|