| | |
| | | grantedAuthorities.add(new SimpleGrantedAuthority(RoleEnum.DEPT_ADMIN.getRoleName())); |
| | | } |
| | | grantedAuthorities.add(new SimpleGrantedAuthority(RoleEnum.fromCode(user.getRole()).getRoleName())); |
| | | // 获取该用户管理部门 |
| | | // 获取该用户管理部门及其下级 |
| | | List<Integer> deptAdminIds = userService.getDeptAdminIds(user.getId()); |
| | | if (! CollectionUtils.isEmpty(deptAdminIds)) { |
| | | deptAdminIds = departmentMapper.getChilds(deptAdminIds); // 查询子部门 |
| | | } |
| | | if (CollectionUtils.isEmpty(deptAdminIds)) { |
| | | // 如果是普通学员,查出所在部门 |
| | | deptAdminIds = userService.getDeptIds(user.getId()); |