feat(auth+config+workflow+message+plugin): 为 5 个基础模块添加 permissions() 声明
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- erp-auth: 23 个权限码(用户/角色/权限/组织/部门/岗位)
- erp-config: 18 个权限码(字典/菜单/配置/编号/主题/语言)
- erp-workflow: 8 个权限码(流程定义/实例/任务)
- erp-message: 5 个权限码(消息/模板),补充缺失的 message.template.manage
- erp-plugin: 2 个权限码(插件管理/查看)
- 同步更新 seed.rs 的 READ_PERM_INDICES 索引和权限计数

使得 sync_module_permissions() 可以动态注册这些权限,与 erp-health/erp-dialysis/erp-ai 模式一致。
This commit is contained in:
iven
2026-04-30 22:41:26 +08:00
parent 8f9895be98
commit f05ca00c75
6 changed files with 102 additions and 8 deletions

View File

@@ -302,6 +302,13 @@ const DEFAULT_PERMISSIONS: &[(&str, &str, &str, &str, &str)] = &[
"create",
"创建消息模板",
),
(
"message.template.manage",
"管理消息模板",
"message.template",
"manage",
"编辑、删除消息模板",
),
// === Plugin module ===
(
"plugin.admin",
@@ -339,13 +346,13 @@ const READ_PERM_INDICES: &[usize] = &[
44, // workflow.read
49, // message.list
51, // message.template.list
53, // plugin.list
54, // plugin.list
];
/// Seed default auth data for a new tenant.
///
/// Creates:
/// - 53 permissions covering auth/config/workflow/message modules
/// - 56 permissions covering auth/config/workflow/message/plugin modules
/// - An "admin" system role with all permissions
/// - A "viewer" system role with read-only permissions
/// - A super-admin user with the admin role and a password credential