aloyszhang commented on code in PR #10327:
URL: https://github.com/apache/inlong/pull/10327#discussion_r1622287818
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/group/InlongGroupServiceImpl.java:
##########
@@ -293,6 +305,30 @@ public InlongGroupInfo get(String groupId, UserInfo
opInfo) {
return groupInfo;
}
+ @Override
+ public String getTenant(String groupId, String operator) {
+ InlongGroupEntity groupEntity =
groupMapper.selectByGroupIdWithoutTenant(groupId);
+ String tenant = groupEntity.getTenant();
+ if (Objects.equals(InlongConstants.DEFAULT_PULSAR_TENANT, tenant)) {
+ return tenant;
+ }
+ InlongTenantInfo tenantInfo = tenantService.getByName(tenant);
+ if (tenantInfo == null) {
+ String errMsg = String.format("tenant=[%s] not found", tenant);
+ LOGGER.error(errMsg);
+ throw new BusinessException(errMsg);
+ }
+
+ InlongRoleInfo inlongRoleInfo =
inlongRoleService.getByUsername(operator);
+ TenantUserRoleEntity tenantRoleInfo =
tenantUserRoleEntityMapper.selectByUsernameAndTenant(operator, tenant);
+ if (inlongRoleInfo == null && tenantRoleInfo == null) {
Review Comment:
what if only `inlongRoleInfo` or `tenantRoleInfo` is null?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]