|
|
@ -19,7 +19,6 @@ package org.apache.dolphinscheduler.api.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import static java.util.stream.Collectors.toSet; |
|
|
|
import static java.util.stream.Collectors.toSet; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_MOVE; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_MOVE; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_DELETE; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_LIST; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_LIST; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_BATCH_COPY; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_BATCH_COPY; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_CREATE; |
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_CREATE; |
|
|
@ -282,8 +281,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
|
|
|
|
|
|
|
|
// check if user have write perm for project
|
|
|
|
// check if user have write perm for project
|
|
|
|
Map<String, Object> result = |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_CREATE); |
|
|
|
|
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -765,8 +763,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
// check if user have write perm for project
|
|
|
|
// check if user have write perm for project
|
|
|
|
Map<String, Object> result = |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_UPDATE); |
|
|
|
|
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -2397,8 +2394,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
int version) { |
|
|
|
int version) { |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
// check if user have write perm for project
|
|
|
|
// check if user have write perm for project
|
|
|
|
Map<String, Object> result = |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, VERSION_DELETE); |
|
|
|
|
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -2459,8 +2455,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
// check if user have write perm for project
|
|
|
|
// check if user have write perm for project
|
|
|
|
Map<String, Object> result = |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_CREATE); |
|
|
|
|
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
return result; |
|
|
|
return result; |
|
|
@ -2595,8 +2590,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
ProcessExecutionTypeEnum executionType) { |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
// check if user have write perm for project
|
|
|
|
// check if user have write perm for project
|
|
|
|
Map<String, Object> result = |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_UPDATE); |
|
|
|
|
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result); |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
if (!hasProjectAndWritePerm) { |
|
|
|
return result; |
|
|
|
return result; |
|
|
|