feat(auth+config+workflow+message+plugin): 为 5 个基础模块添加 permissions() 声明
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user