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

@@ -1,7 +1,7 @@
use async_trait::async_trait;
use axum::Router;
use axum::routing::{delete, get, post, put};
use erp_core::module::ErpModule;
use erp_core::module::{ErpModule, PermissionDescriptor};
pub struct PluginModule;
@@ -15,6 +15,13 @@ impl ErpModule for PluginModule {
vec!["auth", "config"]
}
fn permissions(&self) -> Vec<PermissionDescriptor> {
vec![
PermissionDescriptor { code: "plugin.admin".into(), name: "插件管理".into(), description: "管理插件全生命周期".into(), module: "plugin".into() },
PermissionDescriptor { code: "plugin.list".into(), name: "查看插件".into(), description: "查看插件列表".into(), module: "plugin".into() },
]
}
fn as_any(&self) -> &dyn std::any::Any {
self
}