You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ab...@apache.org on 2015/04/02 21:43:18 UTC

sqoop git commit: SQOOP-2278: Sqoop2: Fix bug for all user could read connector

Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 8eee6f52b -> cbdf96544


SQOOP-2278: Sqoop2: Fix bug for all user could read connector

(Richard Zhou via Abraham Elmahrek)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/cbdf9654
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/cbdf9654
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/cbdf9654

Branch: refs/heads/sqoop2
Commit: cbdf9654414cb10c8b67f11bc63efcf8ffc1532e
Parents: 8eee6f5
Author: Abraham Elmahrek <ab...@apache.org>
Authored: Thu Apr 2 12:41:54 2015 -0700
Committer: Abraham Elmahrek <ab...@apache.org>
Committed: Thu Apr 2 12:41:54 2015 -0700

----------------------------------------------------------------------
 .../sqoop/security/Authorization/AuthorizationEngine.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/cbdf9654/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
----------------------------------------------------------------------
diff --git a/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java b/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
index 8c718e3..e6bf8be 100644
--- a/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
+++ b/security/src/main/java/org/apache/sqoop/security/Authorization/AuthorizationEngine.java
@@ -181,12 +181,13 @@ public class AuthorizationEngine {
         if (!user_name.equals(link.getCreationUser())) {
           privilegesNeedCheck.add(privilege);
         }
-      }
-      if (MResource.TYPE.JOB.name().equalsIgnoreCase(privilege.getResource().getType())) {
+      } else if (MResource.TYPE.JOB.name().equalsIgnoreCase(privilege.getResource().getType())) {
         MJob job = repository.findJob(Long.valueOf(privilege.getResource().getName()));
         if (!user_name.equals(job.getCreationUser())) {
           privilegesNeedCheck.add(privilege);
         }
+      } else {
+        privilegesNeedCheck.add(privilege);
       }
     }