|
@@ -66,7 +66,7 @@ public class MdeRoleServiceImpl implements MdeRoleService {
|
|
|
MdeRoleDO role = BeanUtils.toBean(createReqVO, MdeRoleDO.class)
|
|
|
.setEnterpriseId(LoginUserContext.getEnterpriseId())
|
|
|
.setType(ObjectUtil.defaultIfNull(type, MdeRoleTypeEnum.CUSTOM.getType().toString()))
|
|
|
- .setDataScope(MdeDataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限
|
|
|
+ .setDataScope(MdeDataScopeEnum.SELF.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限
|
|
|
roleMapper.insert(role);
|
|
|
|
|
|
// 3. 记录操作日志上下文
|
|
@@ -141,7 +141,7 @@ public class MdeRoleServiceImpl implements MdeRoleService {
|
|
|
throw exception(MDE_ROLE_ADMIN_CODE_ERROR, code);
|
|
|
}
|
|
|
// 1. 该 name 名字被其它角色所使用
|
|
|
- MdeRoleDO role = roleMapper.selectByName(name);
|
|
|
+ MdeRoleDO role = roleMapper.selectByName(LoginUserContext.getEnterpriseId(),name);
|
|
|
if (role != null && !role.getId().equals(id)) {
|
|
|
throw exception(MDE_ROLE_NAME_DUPLICATE, name);
|
|
|
}
|
|
@@ -150,7 +150,7 @@ public class MdeRoleServiceImpl implements MdeRoleService {
|
|
|
return;
|
|
|
}
|
|
|
// 该 code 编码被其它角色所使用
|
|
|
- role = roleMapper.selectByCode(code);
|
|
|
+ role = roleMapper.selectByCode(LoginUserContext.getEnterpriseId(),code);
|
|
|
if (role != null && !role.getId().equals(id)) {
|
|
|
throw exception(MDE_ROLE_CODE_DUPLICATE, code);
|
|
|
}
|