Commit 1044e1ac72df8b8f01fba2dccf90e086b9734beb
1 parent
0bac2838
修改角色中部门及以下权限问题
Showing
1 changed file
with
2 additions
and
0 deletions
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java
| @@ -385,6 +385,8 @@ public class PermissionServiceImpl implements PermissionService { | @@ -385,6 +385,8 @@ public class PermissionServiceImpl implements PermissionService { | ||
| 385 | if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { | 385 | if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) { |
| 386 | List<DeptDO> depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); | 386 | List<DeptDO> depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true); |
| 387 | CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId)); | 387 | CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId)); |
| 388 | + //添加本身部门id | ||
| 389 | + CollUtil.addAll(result.getDeptIds(), loginUser.getDeptId()); | ||
| 388 | continue; | 390 | continue; |
| 389 | } | 391 | } |
| 390 | // 情况五,SELF | 392 | // 情况五,SELF |