|
|
@ -84,6 +84,7 @@ public class SysRoleController extends BaseController {
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
public AjaxResult edit(@Validated @RequestBody SysRole role) {
|
|
|
|
public AjaxResult edit(@Validated @RequestBody SysRole role) {
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId());
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
|
|
|
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
|
|
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
|
|
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
|
|
|
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
|
|
|
} else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
|
|
|
@ -101,6 +102,7 @@ public class SysRoleController extends BaseController {
|
|
|
|
@PutMapping("/dataScope")
|
|
|
|
@PutMapping("/dataScope")
|
|
|
|
public AjaxResult dataScope(@RequestBody SysRole role) {
|
|
|
|
public AjaxResult dataScope(@RequestBody SysRole role) {
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId());
|
|
|
|
return toAjax(roleService.authDataScope(role));
|
|
|
|
return toAjax(roleService.authDataScope(role));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -112,6 +114,7 @@ public class SysRoleController extends BaseController {
|
|
|
|
@PutMapping("/changeStatus")
|
|
|
|
@PutMapping("/changeStatus")
|
|
|
|
public AjaxResult changeStatus(@RequestBody SysRole role) {
|
|
|
|
public AjaxResult changeStatus(@RequestBody SysRole role) {
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
roleService.checkRoleAllowed(role);
|
|
|
|
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId());
|
|
|
|
role.setUpdateBy(LoginHelper.getUsername());
|
|
|
|
role.setUpdateBy(LoginHelper.getUsername());
|
|
|
|
return toAjax(roleService.updateRoleStatus(role));
|
|
|
|
return toAjax(roleService.updateRoleStatus(role));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -180,6 +183,7 @@ public class SysRoleController extends BaseController {
|
|
|
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
|
|
@Log(title = "角色管理", businessType = BusinessType.GRANT)
|
|
|
|
@PutMapping("/authUser/selectAll")
|
|
|
|
@PutMapping("/authUser/selectAll")
|
|
|
|
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
|
|
|
|
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
|
|
|
|
|
|
|
|
roleService.checkRoleDataScope(roleId);
|
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|