You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/06 07:01:22 UTC

[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11782: [Improvement-11773][api] Optimize the log printing of the api module according…

caishunfeng commented on code in PR #11782:
URL: https://github.com/apache/dolphinscheduler/pull/11782#discussion_r963321439


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/permission/ResourcePermissionCheckServiceImpl.java:
##########
@@ -107,6 +107,8 @@ public boolean resourcePermissionCheck(Object authorizationType, Object[] needCh
             Set<?> originResSet = new HashSet<>(Arrays.asList(needChecks));
             Set<?> ownResSets = RESOURCE_LIST_MAP.get(authorizationType).listAuthorizedResource(userId, logger);
             originResSet.removeAll(ownResSets);
+            if (!originResSet.isEmpty())

Review Comment:
   ```suggestion
               if (CollectionUtils.isNotEmpty(originResSet)) {
                    logger.warn("User does not have resource permission {} on associated resources, userId:{}", authorizationType, userId);
               }
   ```



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:
##########
@@ -278,10 +290,16 @@ public Map<String, Object> deleteTenantById(User loginUser, int id) throws Excep
           storageOperate.deleteTenant(tenant.getTenantCode());
         }
 
-        tenantMapper.deleteById(id);
-        processInstanceMapper.updateProcessInstanceByTenantId(id, -1);
+        int delete = tenantMapper.deleteById(id);

Review Comment:
   Need to update the UT case.



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:
##########
@@ -229,9 +232,14 @@ public Map<String, Object> updateTenant(User loginUser, int id, String tenantCod
         if (!Objects.equals(existsTenant.getTenantCode(), updateTenant.getTenantCode()) && PropertyUtils.getResUploadStartupState()) {
             storageOperate.createTenantDirIfNotExists(tenantCode);
         }
-        tenantMapper.updateById(updateTenant);
-
-        putMsg(result, Status.SUCCESS);
+        int update = tenantMapper.updateById(updateTenant);

Review Comment:
   Need to update the UT case.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org