|
|
@ -133,12 +133,15 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean submit(Role role) { |
|
|
|
public boolean submit(Role role) { |
|
|
|
role.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
|
|
|
|
|
|
|
if (!SecureUtil.isAdministrator()) { |
|
|
|
if (!SecureUtil.isAdministrator()) { |
|
|
|
if (Func.toStr(role.getRoleAlias()).equals(RoleConstant.ADMINISTRATOR)) { |
|
|
|
if (Func.toStr(role.getRoleAlias()).equals(RoleConstant.ADMINISTRATOR)) { |
|
|
|
throw new ServiceException("无权限创建超管角色!"); |
|
|
|
throw new ServiceException("无权限创建超管角色!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isEmpty(role.getParentId())) { |
|
|
|
|
|
|
|
role.setParentId(BladeConstant.TOP_PARENT_ID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
role.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
|
|
|
return saveOrUpdate(role); |
|
|
|
return saveOrUpdate(role); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|