@nocobase/plugin-acl 1.4.0-alpha.20241105053324 → 1.4.0-alpha.3
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/externalVersion.js
CHANGED
|
@@ -11,21 +11,21 @@ module.exports = {
|
|
|
11
11
|
"antd": "5.12.8",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-i18next": "11.18.6",
|
|
14
|
-
"@nocobase/client": "1.4.0-alpha.
|
|
14
|
+
"@nocobase/client": "1.4.0-alpha.3",
|
|
15
15
|
"@formily/shared": "2.3.2",
|
|
16
16
|
"@formily/react": "2.3.0",
|
|
17
17
|
"@ant-design/icons": "5.2.6",
|
|
18
|
-
"@nocobase/utils": "1.4.0-alpha.
|
|
19
|
-
"@nocobase/actions": "1.4.0-alpha.
|
|
20
|
-
"@nocobase/cache": "1.4.0-alpha.
|
|
21
|
-
"@nocobase/database": "1.4.0-alpha.
|
|
22
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
18
|
+
"@nocobase/utils": "1.4.0-alpha.3",
|
|
19
|
+
"@nocobase/actions": "1.4.0-alpha.3",
|
|
20
|
+
"@nocobase/cache": "1.4.0-alpha.3",
|
|
21
|
+
"@nocobase/database": "1.4.0-alpha.3",
|
|
22
|
+
"@nocobase/server": "1.4.0-alpha.3",
|
|
23
23
|
"async-mutex": "0.3.2",
|
|
24
24
|
"lodash": "4.17.21",
|
|
25
|
-
"@nocobase/test": "1.4.0-alpha.
|
|
25
|
+
"@nocobase/test": "1.4.0-alpha.3",
|
|
26
26
|
"@formily/core": "2.3.0",
|
|
27
27
|
"ahooks": "3.7.8",
|
|
28
28
|
"@formily/antd-v5": "1.1.9",
|
|
29
29
|
"antd-style": "3.7.1",
|
|
30
|
-
"@nocobase/acl": "1.4.0-alpha.
|
|
30
|
+
"@nocobase/acl": "1.4.0-alpha.3"
|
|
31
31
|
};
|
|
@@ -65,6 +65,9 @@ function createWithACLMetaMiddleware() {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
const Model = collection.model;
|
|
68
|
+
if (collection.isMultiFilterTargetKey()) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
68
71
|
const primaryKeyField = Model.primaryKeyField || Model.primaryKeyAttribute;
|
|
69
72
|
let listData;
|
|
70
73
|
if ((_a = ctx.body) == null ? void 0 : _a.data) {
|
|
@@ -143,6 +146,9 @@ function createWithACLMetaMiddleware() {
|
|
|
143
146
|
}
|
|
144
147
|
return listData.map((item) => item[primaryKeyField]);
|
|
145
148
|
})();
|
|
149
|
+
if (ids.filter(Boolean).length == 0) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
146
152
|
const conditions = [];
|
|
147
153
|
const allAllowed = [];
|
|
148
154
|
for (const [action, params, actionCtx] of actionsParams) {
|
package/dist/server/server.js
CHANGED
|
@@ -414,11 +414,11 @@ class PluginACLServer extends import_server.Plugin {
|
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
});
|
|
417
|
-
this.app.
|
|
417
|
+
this.app.resourceManager.use(async function showAnonymous(ctx, next) {
|
|
418
418
|
const { actionName, resourceName, params } = ctx.action;
|
|
419
|
-
const { showAnonymous } = params || {};
|
|
419
|
+
const { showAnonymous: showAnonymous2 } = params || {};
|
|
420
420
|
if (actionName === "list" && resourceName === "roles") {
|
|
421
|
-
if (!
|
|
421
|
+
if (!showAnonymous2) {
|
|
422
422
|
ctx.action.mergeParams({
|
|
423
423
|
filter: {
|
|
424
424
|
"name.$ne": "anonymous"
|
|
@@ -515,7 +515,7 @@ class PluginACLServer extends import_server.Plugin {
|
|
|
515
515
|
);
|
|
516
516
|
const withACLMeta = (0, import_with_acl_meta.createWithACLMetaMiddleware)();
|
|
517
517
|
this.app.use(
|
|
518
|
-
async (ctx, next)
|
|
518
|
+
async function withACLMetaMiddleware(ctx, next) {
|
|
519
519
|
try {
|
|
520
520
|
await withACLMeta(ctx, next);
|
|
521
521
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "权限控制",
|
|
5
5
|
"description": "Based on roles, resources, and actions, access control can precisely manage interface configuration permissions, data operation permissions, menu access permissions, and plugin permissions.",
|
|
6
6
|
"description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
|
|
7
|
-
"version": "1.4.0-alpha.
|
|
7
|
+
"version": "1.4.0-alpha.3",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/acl",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
35
35
|
"directory": "packages/plugins/acl"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9268a5b29cbbe9f83255e5cd66fa82f012aab46a"
|
|
38
38
|
}
|