超管用户可获取所有角色
This commit is contained in:
@@ -71,7 +71,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
updateById(sysUser);
|
||||
|
||||
// 绑定角色
|
||||
long roleCount = sysRoleMapper.selectCountByQuery(new QueryWrapper().eq(SysRole::getId, roleId).eq(SysRole::getCreateUserId, StpKit.USER.getLoginIdAsLong()));
|
||||
long roleCount = sysRoleMapper.selectCountByQuery(new QueryWrapper().eq(SysRole::getId, roleId).eq(SysRole::getCreateUserId, StpKit.USER.isAdmin() ? null : StpKit.USER.getLoginIdAsLong()));
|
||||
if (roleCount == 0) {
|
||||
throw new CzgException("角色不存在");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user