@nocobase/plugin-acl 2.0.60 → 2.0.61

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.
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.0.60",
11
+ "@nocobase/client": "2.0.61",
12
12
  "antd": "5.24.2",
13
13
  "react": "18.2.0",
14
14
  "react-i18next": "11.18.6",
@@ -17,13 +17,13 @@ module.exports = {
17
17
  "@formily/react": "2.3.7",
18
18
  "@ant-design/icons": "5.6.1",
19
19
  "lodash": "4.18.1",
20
- "@nocobase/utils": "2.0.60",
21
- "@nocobase/actions": "2.0.60",
22
- "@nocobase/cache": "2.0.60",
23
- "@nocobase/database": "2.0.60",
24
- "@nocobase/server": "2.0.60",
25
- "@nocobase/acl": "2.0.60",
26
- "@nocobase/test": "2.0.60",
20
+ "@nocobase/utils": "2.0.61",
21
+ "@nocobase/actions": "2.0.61",
22
+ "@nocobase/cache": "2.0.61",
23
+ "@nocobase/database": "2.0.61",
24
+ "@nocobase/server": "2.0.61",
25
+ "@nocobase/acl": "2.0.61",
26
+ "@nocobase/test": "2.0.61",
27
27
  "@formily/core": "2.3.7",
28
28
  "@formily/antd-v5": "1.2.3",
29
29
  "antd-style": "3.7.1"
@@ -43,7 +43,7 @@ var import_constants = require("../constants");
43
43
  var import_enum = require("../enum");
44
44
  var import_lodash = __toESM(require("lodash"));
45
45
  async function setCurrentRole(ctx, next) {
46
- var _a, _b, _c;
46
+ var _a, _b;
47
47
  let currentRole = ctx.get("X-Role");
48
48
  if (currentRole === "anonymous") {
49
49
  ctx.state.currentRole = currentRole;
@@ -114,7 +114,7 @@ async function setCurrentRole(ctx, next) {
114
114
  role = (defaultRoleModel == null ? void 0 : defaultRoleModel.roleName) || ((_b = userRoles[0]) == null ? void 0 : _b.name);
115
115
  }
116
116
  ctx.state.currentRole = role;
117
- ctx.state.currentRoles = role === import_constants.UNION_ROLE_KEY ? [(_c = userRoles[0]) == null ? void 0 : _c.name] : [role];
117
+ ctx.state.currentRoles = role === import_constants.UNION_ROLE_KEY ? userRoles.map((role2) => role2.name) : [role];
118
118
  if (!ctx.state.currentRoles.length) {
119
119
  return ctx.throw(401, {
120
120
  code: "ROLE_NOT_FOUND_ERR",
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.60",
9
+ "version": "2.0.61",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/acl",
@@ -44,5 +44,5 @@
44
44
  "url": "git+https://github.com/nocobase/nocobase.git",
45
45
  "directory": "packages/plugins/acl"
46
46
  },
47
- "gitHead": "c9bdc985d79d20e88c93cb2eee9bbf24a382ee08"
47
+ "gitHead": "974b351c96c0a7a8ce9fd8cdc70a732a332bd7cf"
48
48
  }