Browse Source

Merge pull request #3980 from lgcareer/1.3.3-release-fix3958

[Fix-#3958][api] files should not be created successfully in the directory of the authorized file
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
292b0fce0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

13
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

@ -961,6 +961,19 @@ public class ResourcesService extends BaseService {
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
if (pid != -1) {
Resource parentResource = resourcesMapper.selectById(pid);
if (parentResource == null) {
putMsg(result, Status.PARENT_RESOURCE_NOT_EXIST);
return result;
}
if (!hasPerm(loginUser, parentResource.getUserId())) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
}
// save data
Date now = new Date();

Loading…
Cancel
Save