This is an automated email from the ASF dual-hosted git repository.

leonbao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new b2a2fbd  Revert "fix the magic number userId '0' (#6368)" (#6378)
b2a2fbd is described below

commit b2a2fbda1d25c4eb18cf58ceb6d062b74855cedd
Author: Kirs <[email protected]>
AuthorDate: Mon Sep 27 18:50:08 2021 +0800

    Revert "fix the magic number userId '0' (#6368)" (#6378)
    
    This reverts commit 7413b578410a53c4839920edfdf98ac89344b959.
    
    Co-authored-by: OS <[email protected]>
---
 .../dolphinscheduler/api/service/impl/ResourcesServiceImpl.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
index 75fd511..f0cbcc9 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
+++ 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
@@ -136,7 +136,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl 
implements ResourcesSe
             return result;
         }
 
-        if (checkResourceExists(fullName, loginUser.getId(), type.ordinal())) {
+        if (checkResourceExists(fullName, 0, type.ordinal())) {
             logger.error("resource directory {} has exist, can't recreate", 
fullName);
             putMsg(result, Status.RESOURCE_EXIST);
             return result;
@@ -208,7 +208,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl 
implements ResourcesSe
 
         // check resource name exists
         String fullName = currentDir.equals("/") ? 
String.format("%s%s",currentDir,name) : String.format("%s/%s",currentDir,name);
-        if (checkResourceExists(fullName, loginUser.getId(), type.ordinal())) {
+        if (checkResourceExists(fullName, 0, type.ordinal())) {
             logger.error("resource {} has exist, can't recreate", 
RegexUtils.escapeNRT(name));
             putMsg(result, Status.RESOURCE_EXIST);
             return result;
@@ -298,7 +298,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl 
implements ResourcesSe
         String originResourceName = resource.getAlias();
 
         String fullName = 
String.format("%s%s",originFullName.substring(0,originFullName.lastIndexOf("/") 
+ 1),name);
-        if (!originResourceName.equals(name) && checkResourceExists(fullName, 
loginUser.getId(), type.ordinal())) {
+        if (!originResourceName.equals(name) && checkResourceExists(fullName, 
0, type.ordinal())) {
             logger.error("resource {} already exists, can't recreate", name);
             putMsg(result, Status.RESOURCE_EXIST);
             return result;
@@ -751,7 +751,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl 
implements ResourcesSe
     public Result<Object> verifyResourceName(String fullName, ResourceType 
type, User loginUser) {
         Result<Object> result = new Result<>();
         putMsg(result, Status.SUCCESS);
-        if (checkResourceExists(fullName, loginUser.getId(), type.ordinal())) {
+        if (checkResourceExists(fullName, 0, type.ordinal())) {
             logger.error("resource type:{} name:{} has exist, can't create 
again.", type, RegexUtils.escapeNRT(fullName));
             putMsg(result, Status.RESOURCE_EXIST);
         } else {

Reply via email to