|
@@ -95,6 +95,7 @@ public class SysRoleController extends BaseController {
|
|
|
@PutMapping
|
|
|
public AjaxResult<Void> edit(@Validated @RequestBody SysRole role) {
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
+ roleService.checkRoleDataScope(role.getRoleId());
|
|
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
|
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
|
@@ -123,6 +124,7 @@ public class SysRoleController extends BaseController {
|
|
|
@PutMapping("/dataScope")
|
|
|
public AjaxResult<Void> dataScope(@RequestBody SysRole role) {
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
+ roleService.checkRoleDataScope(role.getRoleId());
|
|
|
return toAjax(roleService.authDataScope(role));
|
|
|
}
|
|
|
|
|
@@ -135,6 +137,7 @@ public class SysRoleController extends BaseController {
|
|
|
@PutMapping("/changeStatus")
|
|
|
public AjaxResult<Void> changeStatus(@RequestBody SysRole role) {
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
+ roleService.checkRoleDataScope(role.getRoleId());
|
|
|
return toAjax(roleService.updateRoleStatus(role));
|
|
|
}
|
|
|
|
|
@@ -217,6 +220,7 @@ public class SysRoleController extends BaseController {
|
|
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
|
@PutMapping("/authUser/selectAll")
|
|
|
public AjaxResult<Void> selectAuthUserAll(Long roleId, Long[] userIds) {
|
|
|
+ roleService.checkRoleDataScope(roleId);
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
|
|
}
|
|
|
}
|