sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject sentry git commit: SENTRY-1293: Avoid converting string permission to Privilege object (Hao Hao, Reviewed by: Lenni Kuff)
Date Tue, 24 May 2016 18:15:20 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 78e0393a3 -> f222f3ec3


SENTRY-1293: Avoid converting string permission to Privilege object (Hao Hao, Reviewed by:
Lenni Kuff)

Change-Id: I7aba74fc9789b33945bc6326075accbe6c17d900


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

Branch: refs/heads/master
Commit: f222f3ec38b8cdfabad3ba0fad9206615a09e96c
Parents: 78e0393
Author: hahao <hao.hao@cloudera.com>
Authored: Tue May 24 11:14:30 2016 -0700
Committer: hahao <hao.hao@cloudera.com>
Committed: Tue May 24 11:14:30 2016 -0700

----------------------------------------------------------------------
 .../sentry/provider/common/ResourceAuthorizationProvider.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/f222f3ec/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
index afead3f..4e22071 100644
--- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java
@@ -109,11 +109,12 @@ public abstract class ResourceAuthorizationProvider implements AuthorizationProv
     lastFailedPrivileges.get().clear();
 
     for (String requestPrivilege : requestPrivileges) {
+      Privilege priv = privilegeFactory.createPrivilege(requestPrivilege);
       for (Privilege permission : privileges) {
         /*
          * Does the permission granted in the policy file imply the requested action?
          */
-        boolean result = permission.implies(privilegeFactory.createPrivilege(requestPrivilege),
model);
+        boolean result = permission.implies(priv, model);
         if (LOGGER.isDebugEnabled()) {
           LOGGER.debug("ProviderPrivilege {}, RequestPrivilege {}, RoleSet, {}, Result {}",
               new Object[]{ permission, requestPrivilege, roleSet, result});


Mime
View raw message