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 2021/11/30 16:42:50 UTC

[GitHub] [dolphinscheduler] zwZjut commented on a change in pull request #7082: [Feature][dolphinscheduler-api] access control of taskDefinition and taskInstance in project to #7081

zwZjut commented on a change in pull request #7082:
URL: https://github.com/apache/dolphinscheduler/pull/7082#discussion_r759466294



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java
##########
@@ -171,6 +176,12 @@ public Result queryTaskListPaging(User loginUser,
             return result;
         }
 
+        TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(task.getTaskCode());
+        if (taskDefinition != null && projectCode != taskDefinition.getProjectCode()) {
+            putMsg(result, Status.TASK_INSTANCE_NOT_FOUND, taskInstanceId);

Review comment:
       The purpose is to determine whether TaskInstance belongs to project but  project_code is not in t_ds_task_instance, now we have to query t_ds_task_definition to judge  whether TaskInstance belongs to project , if (taskDefinition != null && projectCode != taskDefinition.getProjectCode()) means taskInstanceId  does not belong to the project. 




-- 
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