rebuildRoleAreaScope
This commit is contained in:
parent
e81c17a318
commit
11148c9932
|
|
@ -134,6 +134,7 @@ public class SysRoleController extends BaseController
|
|||
return error("内置角色不允许修改");
|
||||
}
|
||||
role.setUpdateBy(SecurityUtils.getUsername());
|
||||
roleService.rebuildRoleAreaScope(role);
|
||||
return toAjax(roleService.updateRole(role));
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
|
|
@ -152,6 +153,7 @@ public class SysRoleController extends BaseController
|
|||
try{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
roleService.rebuildRoleCanteenScope(role);
|
||||
return toAjax(roleService.authDataScope(role));
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
|
|
@ -159,39 +161,39 @@ public class SysRoleController extends BaseController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:role:edit"))
|
||||
@PostMapping("/roleArea/edit")
|
||||
@SysLog(title = "角色管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->角色管理->区域权限",details = "修改权限")
|
||||
public AjaxResult rebuildRoleAreaScope(@RequestBody SysRole role) {
|
||||
try{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.rebuildRoleAreaScope(role));
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存数据权限
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:role:edit"))
|
||||
@PostMapping("/roleCanteen/edit")
|
||||
@SysLog(title = "角色管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->角色管理->食堂权限",details = "修改权限")
|
||||
public AjaxResult rebuildRoleCanteenScope(@RequestBody SysRole role) {
|
||||
try{
|
||||
roleService.checkRoleAllowed(role);
|
||||
roleService.checkRoleDataScope(role.getRoleId());
|
||||
return toAjax(roleService.rebuildRoleCanteenScope(role));
|
||||
}catch (Exception e){
|
||||
logger.error(e.toString(),e);
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * 修改保存数据权限
|
||||
// */
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:role:edit"))
|
||||
// @PostMapping("/roleArea/edit")
|
||||
// @SysLog(title = "角色管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->角色管理->区域权限",details = "修改权限")
|
||||
// public AjaxResult rebuildRoleAreaScope(@RequestBody SysRole role) {
|
||||
// try{
|
||||
// roleService.checkRoleAllowed(role);
|
||||
// roleService.checkRoleDataScope(role.getRoleId());
|
||||
// return toAjax(roleService.rebuildRoleAreaScope(role));
|
||||
// }catch (Exception e){
|
||||
// logger.error(e.toString(),e);
|
||||
// return error(e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改保存数据权限
|
||||
// */
|
||||
// @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:role:edit"))
|
||||
// @PostMapping("/roleCanteen/edit")
|
||||
// @SysLog(title = "角色管理", businessType = OperaType.UPDATE,logType = 0,module = "系统管理->角色管理->食堂权限",details = "修改权限")
|
||||
// public AjaxResult rebuildRoleCanteenScope(@RequestBody SysRole role) {
|
||||
// try{
|
||||
// roleService.checkRoleAllowed(role);
|
||||
// roleService.checkRoleDataScope(role.getRoleId());
|
||||
// return toAjax(roleService.rebuildRoleCanteenScope(role));
|
||||
// }catch (Exception e){
|
||||
// logger.error(e.toString(),e);
|
||||
// return error(e.getMessage());
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
|||
// 新增角色信息
|
||||
role.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId());
|
||||
roleMapper.insertRole(role);
|
||||
insertRoleArea(role);
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue