fix: 收口管理端页面权限与工作流运行授权

- 页面选项接口改用所属页面权限并返回最小数据视图

- 统一校验工作流引用、租户、状态与定时任务执行主体

- 补充聊天记录权限迁移和权限隔离回归测试
This commit is contained in:
2026-08-07 12:51:21 +08:00
parent 6ad004da9b
commit d244a0404d
55 changed files with 3350 additions and 387 deletions

View File

@@ -2,52 +2,38 @@ package tech.easyflow.system.config;
import tech.easyflow.common.util.SpringContextUtil;
import tech.easyflow.common.dict.DictManager;
import tech.easyflow.common.dict.loader.DbDataLoader;
import tech.easyflow.system.entity.SysDict;
import tech.easyflow.system.mapper.*;
import tech.easyflow.system.service.SysDictService;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import javax.annotation.Resource;
import java.util.List;
/**
* 注册由字典表维护的静态业务字典。
*/
@Configuration
public class SysDictAutoConfig {
private SysDictService service;
@Resource
private SysMenuMapper sysMenuMapper;
@Resource
private SysDeptMapper sysDeptMapper;
@Resource
private SysRoleMapper sysRoleMapper;
@Resource
private SysPositionMapper sysPositionMapper;
@Resource
private SysAccountMapper sysAccountMapper;
private final SysDictService service;
/**
* 创建系统字典自动配置。
*
* @param service 系统字典服务
*/
public SysDictAutoConfig(SysDictService service) {
this.service = service;
}
/**
* 应用启动完成后注册静态字典。
*/
@EventListener(ApplicationReadyEvent.class)
public void onApplicationStartup() {
DictManager dictManager = SpringContextUtil.getBean(DictManager.class);
// 菜单表字典
dictManager.putLoader(new DbDataLoader<>("sysMenu", sysMenuMapper, "id", "menu_title", "parent_id", "sort_no asc", false));
// 部门表字典
dictManager.putLoader(new DbDataLoader<>("sysDept", sysDeptMapper, "id", "dept_name", "parent_id", "sort_no asc", false));
// 角色表字典
dictManager.putLoader(new DbDataLoader<>("sysRole", sysRoleMapper, "id", "role_name", null, null, true));
// 职位字典
dictManager.putLoader(new DbDataLoader<>("sysPosition", sysPositionMapper, "id", "position_name", null, null, true));
// 用户字典
dictManager.putLoader(new DbDataLoader<>("sysAccount", sysAccountMapper, "id", "login_name", null, null, true));
List<SysDict> sysDicts = service.list();
if (sysDicts != null) {
sysDicts.forEach(sysDict -> dictManager.putLoader(sysDict.buildLoader()));