|
|
|
@ -73,7 +73,6 @@ public class SysRoleController extends BaseController { |
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:role:query')") |
|
|
|
|
@GetMapping(value = "/{roleId}") |
|
|
|
|
public AjaxResult getInfo(@PathVariable Long roleId) { |
|
|
|
|
roleService.checkRoleDataScope(roleId); |
|
|
|
|
return success(roleService.selectRoleById(roleId)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -102,7 +101,6 @@ public class SysRoleController extends BaseController { |
|
|
|
|
@PutMapping |
|
|
|
|
public AjaxResult edit(@Validated @RequestBody SysRole role) { |
|
|
|
|
roleService.checkRoleAllowed(role); |
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId()); |
|
|
|
|
if (!roleService.checkRoleNameUnique(role)) { |
|
|
|
|
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); |
|
|
|
|
} else if (!roleService.checkRoleKeyUnique(role)) { |
|
|
|
@ -123,18 +121,6 @@ public class SysRoleController extends BaseController { |
|
|
|
|
return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改保存数据权限 |
|
|
|
|
*/ |
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:role:edit')") |
|
|
|
|
@Log(title = "角色管理", businessType = BusinessType.UPDATE) |
|
|
|
|
@PutMapping("/dataScope") |
|
|
|
|
public AjaxResult dataScope(@RequestBody SysRole role) { |
|
|
|
|
roleService.checkRoleAllowed(role); |
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId()); |
|
|
|
|
return toAjax(roleService.authDataScope(role)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 状态修改 |
|
|
|
|
*/ |
|
|
|
@ -143,7 +129,6 @@ public class SysRoleController extends BaseController { |
|
|
|
|
@PutMapping("/changeStatus") |
|
|
|
|
public AjaxResult changeStatus(@RequestBody SysRole role) { |
|
|
|
|
roleService.checkRoleAllowed(role); |
|
|
|
|
roleService.checkRoleDataScope(role.getRoleId()); |
|
|
|
|
role.setUpdateBy(getUsername()); |
|
|
|
|
return toAjax(roleService.updateRoleStatus(role)); |
|
|
|
|
} |
|
|
|
@ -216,7 +201,6 @@ public class SysRoleController extends BaseController { |
|
|
|
|
@Log(title = "角色管理", businessType = BusinessType.GRANT) |
|
|
|
|
@PutMapping("/authUser/selectAll") |
|
|
|
|
public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) { |
|
|
|
|
roleService.checkRoleDataScope(roleId); |
|
|
|
|
return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|