@nocobase/plugin-acl 1.5.16 → 1.5.18

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.
@@ -11,20 +11,20 @@ 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.5.16",
14
+ "@nocobase/client": "1.5.18",
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.5.16",
19
- "@nocobase/actions": "1.5.16",
20
- "@nocobase/cache": "1.5.16",
21
- "@nocobase/database": "1.5.16",
22
- "@nocobase/server": "1.5.16",
18
+ "@nocobase/utils": "1.5.18",
19
+ "@nocobase/actions": "1.5.18",
20
+ "@nocobase/cache": "1.5.18",
21
+ "@nocobase/database": "1.5.18",
22
+ "@nocobase/server": "1.5.18",
23
23
  "lodash": "4.17.21",
24
- "@nocobase/test": "1.5.16",
24
+ "@nocobase/test": "1.5.18",
25
25
  "@formily/core": "2.3.0",
26
26
  "ahooks": "3.7.8",
27
27
  "@formily/antd-v5": "1.1.9",
28
28
  "antd-style": "3.7.1",
29
- "@nocobase/acl": "1.5.16"
29
+ "@nocobase/acl": "1.5.18"
30
30
  };
@@ -241,13 +241,16 @@ function createWithACLMetaMiddleware() {
241
241
  return [ctx.db.sequelize.literal(`CASE WHEN ${condition.whereCase} THEN 1 ELSE 0 END`), condition.action];
242
242
  })
243
243
  ],
244
- include: conditions.map((condition) => condition.include).flat()
244
+ include: conditions.map((condition) => condition.include).flat(),
245
+ raw: true
245
246
  });
246
247
  const allowedActions = inspectActions.map((action) => {
247
248
  if (allAllowed.includes(action)) {
248
249
  return [action, ids];
249
250
  }
250
- return [action, results.filter((item) => Boolean(item.get(action))).map((item) => item.get(primaryKeyField))];
251
+ let actionIds = results.filter((item) => Boolean(item[action])).map((item) => item[primaryKeyField]);
252
+ actionIds = Array.from(new Set(actionIds));
253
+ return [action, actionIds];
251
254
  }).reduce((acc, [action, ids2]) => {
252
255
  acc[action] = ids2;
253
256
  return acc;
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.5.16",
7
+ "version": "1.5.18",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/acl",
@@ -33,5 +33,5 @@
33
33
  "url": "git+https://github.com/nocobase/nocobase.git",
34
34
  "directory": "packages/plugins/acl"
35
35
  },
36
- "gitHead": "b2cfb5c8e233263a23b8b3258aa7700837755429"
36
+ "gitHead": "ab85e258744fa0e2baf812498c14160726d8b37b"
37
37
  }