修改角色

This commit is contained in:
qimingjin 2021-06-22 21:02:43 +08:00
parent c7f42268b8
commit 1055c8e7fb
1 changed files with 2 additions and 1 deletions

View File

@ -231,8 +231,9 @@ public class SysUserController extends BaseController
SysUser user = userService.selectUserById(userId);
// 获取用户所属的角色列表
List<SysRole> roles = roleService.selectRolesByUserId(userId);
List<SysRole> newRoles = roles.stream().filter(t -> t.getRoleType() == 1).collect(Collectors.toList());
mmap.put("user", user);
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("roles", SysUser.isAdmin(userId) ? newRoles : newRoles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
return prefix + "/authRole";
}