@nocobase/plugin-acl 2.0.0-alpha.59 → 2.0.0-alpha.60
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 +8 -8
- package/dist/server/server.js +10 -10
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.0.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.0.0-alpha.60",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
13
|
"react": "18.2.0",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
@@ -17,14 +17,14 @@ module.exports = {
|
|
|
17
17
|
"@formily/react": "2.3.7",
|
|
18
18
|
"@ant-design/icons": "5.6.1",
|
|
19
19
|
"lodash": "4.17.21",
|
|
20
|
-
"@nocobase/utils": "2.0.0-alpha.
|
|
21
|
-
"@nocobase/actions": "2.0.0-alpha.
|
|
22
|
-
"@nocobase/cache": "2.0.0-alpha.
|
|
23
|
-
"@nocobase/database": "2.0.0-alpha.
|
|
24
|
-
"@nocobase/server": "2.0.0-alpha.
|
|
25
|
-
"@nocobase/test": "2.0.0-alpha.
|
|
20
|
+
"@nocobase/utils": "2.0.0-alpha.60",
|
|
21
|
+
"@nocobase/actions": "2.0.0-alpha.60",
|
|
22
|
+
"@nocobase/cache": "2.0.0-alpha.60",
|
|
23
|
+
"@nocobase/database": "2.0.0-alpha.60",
|
|
24
|
+
"@nocobase/server": "2.0.0-alpha.60",
|
|
25
|
+
"@nocobase/test": "2.0.0-alpha.60",
|
|
26
26
|
"@formily/core": "2.3.7",
|
|
27
27
|
"@formily/antd-v5": "1.2.3",
|
|
28
28
|
"antd-style": "3.7.1",
|
|
29
|
-
"@nocobase/acl": "2.0.0-alpha.
|
|
29
|
+
"@nocobase/acl": "2.0.0-alpha.60"
|
|
30
30
|
};
|
package/dist/server/server.js
CHANGED
|
@@ -394,16 +394,6 @@ class PluginACLServer extends import_server.Plugin {
|
|
|
394
394
|
}
|
|
395
395
|
]
|
|
396
396
|
});
|
|
397
|
-
this.app.on("afterLoad", async (app) => {
|
|
398
|
-
app.db.on("rolesUsers.beforeSave", async (model) => {
|
|
399
|
-
if (!model._changed.has("roleName")) {
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
if (model.roleName === "root") {
|
|
403
|
-
throw new Error("No permissions");
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
});
|
|
407
397
|
const rolesResourcesScopes = this.app.db.getRepository("dataSourcesRolesResourcesScopes");
|
|
408
398
|
await rolesResourcesScopes.createMany({
|
|
409
399
|
records: [
|
|
@@ -422,6 +412,16 @@ class PluginACLServer extends import_server.Plugin {
|
|
|
422
412
|
]
|
|
423
413
|
});
|
|
424
414
|
});
|
|
415
|
+
this.app.on("afterStart", async (app) => {
|
|
416
|
+
app.db.on("rolesUsers.beforeSave", async (model) => {
|
|
417
|
+
if (!model._changed.has("roleName")) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (model.roleName === "root") {
|
|
421
|
+
throw new Error("No permissions");
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
425
|
this.app.on("cache:del:roles", ({ userId }) => {
|
|
426
426
|
this.app.cache.del(`roles:${userId}`);
|
|
427
427
|
});
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Based on roles, resources, and actions, access control can precisely manage interface configuration permissions, data operation permissions, menu access permissions, and plugin permissions.",
|
|
7
7
|
"description.ru-RU": "На основе ролей, ресурсов и действий система контроля доступа может точно управлять разрешениями на изменение интерфейса, работу с данными, доступ к меню и разрешениями для подключаемых модулей.",
|
|
8
8
|
"description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
|
|
9
|
-
"version": "2.0.0-alpha.
|
|
9
|
+
"version": "2.0.0-alpha.60",
|
|
10
10
|
"license": "AGPL-3.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/acl",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
40
40
|
"directory": "packages/plugins/acl"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "9113d61ce85b60b7ba3d0e5ca64182d92a15ece4"
|
|
43
43
|
}
|