ruanwenjun commented on code in PR #15757:
URL:
https://github.com/apache/dolphinscheduler/pull/15757#discussion_r1536955832
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java:
##########
@@ -1306,16 +1292,13 @@ public Result<Object> queryResourceBaseDir(User
loginUser, ResourceType type) {
*/
private boolean isUserTenantValid(boolean isAdmin, String userTenantCode,
String resTenantCode) throws
ServiceException {
- if (!isAdmin) {
- resTenantCode = resTenantCode == null ? "" : resTenantCode;
- if (!StringUtils.isBlank(resTenantCode) &&
!resTenantCode.equals(userTenantCode)) {
- // if an ordinary user directly send a query API with a
different tenantCode and fullName "",
- // still he/she does not have read permission.
- return false;
- }
+ if (isAdmin) {
+ return true;
}
-
- return true;
+ if (StringUtils.isEmpty(resTenantCode)) {
+ return true;
+ }
+ return resTenantCode.equals(userTenantCode);
Review Comment:
Will the resTenantCode be empty?
--
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]