@tachybase/module-acl 1.6.24 → 1.6.25

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.
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.6.24",
3
+ "@tachybase/client": "1.6.25",
4
4
  "@tachybase/schema": "1.6.16",
5
5
  "antd": "5.22.5",
6
6
  "@ant-design/icons": "6.1.0",
@@ -1,2 +1,8 @@
1
1
  import { Context } from '@tego/server';
2
+ /**
3
+ * Resolves the current user's role after ACL extensions attach additional roles.
4
+ *
5
+ * @param ctx - Request context containing the authenticated user and role header.
6
+ * @param next - Middleware callback invoked after the current role is resolved.
7
+ */
2
8
  export declare function setCurrentRole(ctx: Context, next: any): Promise<any>;
@@ -30,6 +30,7 @@ async function setCurrentRole(ctx, next) {
30
30
  if (!ctx.state.currentUser) {
31
31
  return next();
32
32
  }
33
+ await ctx.tego.emitAsync("acl:beforeSetCurrentRole", ctx);
33
34
  const attachRoles = ctx.state.attachRoles || [];
34
35
  const cache = ctx.cache;
35
36
  const repository = ctx.db.getRepository("users.roles", ctx.state.currentUser.id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/module-acl",
3
3
  "displayName": "Access control",
4
- "version": "1.6.24",
4
+ "version": "1.6.25",
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
  "keywords": [
7
7
  "Users & permissions"
@@ -33,7 +33,7 @@
33
33
  "react": "18.3.1",
34
34
  "react-dom": "18.3.1",
35
35
  "react-i18next": "16.2.1",
36
- "@tachybase/client": "1.6.24"
36
+ "@tachybase/client": "1.6.25"
37
37
  },
38
38
  "description.zh-CN": "基于角色、资源和操作的权限控制,可以精确控制界面配置权限、数据操作权限、菜单访问权限、插件权限。",
39
39
  "displayName.zh-CN": "权限控制",