|
@@ -57,6 +57,7 @@ public class RoleManagerServiceImpl implements RoleManagerService {
|
|
|
* 创建角色
|
|
|
**/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void createRole(CreateRoleReq req) {
|
|
|
//1-查询上级角色信息
|
|
|
UserRole parentRole = getRoleByCode(req.getParentRoleCode());
|
|
@@ -126,7 +127,11 @@ public class RoleManagerServiceImpl implements RoleManagerService {
|
|
|
* 修改角色
|
|
|
**/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void updateRole(UpdateRoleReq req) {
|
|
|
+ if("admin".equals(req.getRoleCode())){
|
|
|
+ throw new BusinessException("超级管理员不可编辑。");
|
|
|
+ }
|
|
|
//1-查询角色信息
|
|
|
UserRole userRole = getRoleByCode(req.getRoleCode());
|
|
|
AssertUtil.isNull(userRole,"角色不存在");
|
|
@@ -399,6 +404,9 @@ public class RoleManagerServiceImpl implements RoleManagerService {
|
|
|
|
|
|
//循环禁用
|
|
|
for(String roleCode:roleCodeList){
|
|
|
+ if("admin".equals(roleCode)){
|
|
|
+ throw new BusinessException("超级管理员不可停用。");
|
|
|
+ }
|
|
|
//1-查询角色
|
|
|
UserRole role = getRoleByCode(roleCode);
|
|
|
AssertUtil.isNull(role,"角色不存在");
|