Commit c7427134050e9b94437b3ec0310549121fd92c80
1 parent
8c9227fd
refactor(DEFECT-756): 查询账号角色时,只返回启动的角色
Showing
1 changed file
with
8 additions
and
1 deletions
@@ -572,7 +572,14 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | @@ -572,7 +572,14 @@ public class YtUserServiceImpl extends AbstractBaseService<UserMapper, User> | ||
572 | .stream() | 572 | .stream() |
573 | .map(UserRole::getRoleId) | 573 | .map(UserRole::getRoleId) |
574 | .collect(Collectors.toList()); | 574 | .collect(Collectors.toList()); |
575 | - return roleIds.toArray(new String[roleIds.size()]); | 575 | + List<String> enableRoles = roleMapper.selectList(new QueryWrapper<Role>().lambda() |
576 | + .eq(Role::isEnabled, true).in(Role::getId,roleIds)) | ||
577 | + .stream().map(m -> m.getId()) | ||
578 | + .collect(Collectors.toList()); | ||
579 | + if(enableRoles.size() == 0){ | ||
580 | + return null; | ||
581 | + } | ||
582 | + return roleIds.toArray(new String[enableRoles.size()]); | ||
576 | } | 583 | } |
577 | if (roleOrGroupReqDTO.isQueryOrganization()) { | 584 | if (roleOrGroupReqDTO.isQueryOrganization()) { |
578 | List<String> organizationIds = | 585 | List<String> organizationIds = |