Browse Source

Merge pull request #287 from lgcareer/branch-1.0.2

add determine if the login user is the owner of the process definition or schedule
pull/2/head
lgcareer 5 years ago committed by GitHub
parent
commit
c94ad601b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java

8
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java

@ -357,13 +357,19 @@ public class ProcessDefinitionService extends BaseDAGService {
return checkResult;
}
ProcessDefinition processDefinition = processDefineMapper.queryByDefineId(processDefinitionId);
if (processDefinition == null) {
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processDefinitionId);
return result;
}
// Determine if the login user is the owner of the process definition
if (loginUser.getId() != processDefinition.getUserId()) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
// check process definition is already online
if (processDefinition.getReleaseState() == ReleaseState.ONLINE) {
putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE,processDefinitionId);

Loading…
Cancel
Save