houzhongjian
2024-10-16 7da8f196dee8e3c526c009a4bc7f5983ece6bb97
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.system.framework.datapermission.config;
H 2
3 import com.iailab.module.system.dal.dataobject.dept.DeptDO;
4 import com.iailab.module.system.dal.dataobject.user.AdminUserDO;
5 import com.iailab.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
6 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration;
8
9 /**
10  * system 模块的数据权限 Configuration
11  *
12  * @author iailab
13  */
14 @Configuration(proxyBeanMethods = false)
15 public class DataPermissionConfiguration {
16
17     @Bean
18     public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() {
19         return rule -> {
20             // dept
21             rule.addDeptColumn(AdminUserDO.class);
22             rule.addDeptColumn(DeptDO.class, "id");
23             // user
24             rule.addUserColumn(AdminUserDO.class, "id");
25         };
26     }
27
28 }