用户访问控制时校验数据权限,防止越权

This commit is contained in:
RuoYi
2022-01-27 12:05:04 +08:00
parent 8007b22b85
commit 612c4293d1
5 changed files with 15 additions and 3 deletions

View File

@ -361,6 +361,7 @@ public class SysRoleServiceImpl implements ISysRoleService
for (Long roleId : roleIds)
{
checkRoleAllowed(new SysRole(roleId));
checkRoleDataScope(roleId);
SysRole role = selectRoleById(roleId);
if (countUserRoleByRoleId(roleId) > 0)
{

View File

@ -482,6 +482,7 @@ public class SysUserServiceImpl implements ISysUserService
for (Long userId : userIds)
{
checkUserAllowed(new SysUser(userId));
checkUserDataScope(userId);
}
// 删除用户与角色关联
userRoleMapper.deleteUserRole(userIds);