sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sra...@apache.org
Subject git commit: SENTRY-338: Sentry policy import tool adds non-compatible comments to grant privilege statements (Ashish Kumar Singh via Sravya Tirukkovalur)
Date Fri, 29 Aug 2014 18:49:32 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master 7dc84d72d -> 94118851f


SENTRY-338: Sentry policy import tool adds non-compatible comments to grant privilege statements
(Ashish Kumar Singh via Sravya Tirukkovalur)


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

Branch: refs/heads/master
Commit: 94118851fe2675ed1916b930a751415bbc6acf95
Parents: 7dc84d7
Author: Sravya Tirukkovalur <sravya@clouera.com>
Authored: Fri Aug 29 11:48:02 2014 -0700
Committer: Sravya Tirukkovalur <sravya@clouera.com>
Committed: Fri Aug 29 11:48:02 2014 -0700

----------------------------------------------------------------------
 .../binding/hive/authz/SentryConfigTool.java    | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/94118851/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java
index 1c32946..dcd2b8a 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java
@@ -322,23 +322,32 @@ public class SentryConfigTool {
 
           if (uri != null) {
             System.out.println(String.format(
-                "GRANT ALL ON URI %s TO ROLE %s; # server=%s",
-                uri, roleName, server));
+                "# server=%s",
+                server));
+            System.out.println(String.format(
+                "GRANT ALL ON URI %s TO ROLE %s;",
+                uri, roleName));
 
             client.grantURIPrivilege(requestorUserName, roleName, server, uri);
           } else if (table != null && !AccessConstants.ALL.equals(table)) {
             System.out.println(String.format(
-                "GRANT %s ON TABLE %s TO ROLE %s; # server=%s, database=%s",
+                "# server=%s, database=%s",
+                server, database));
+            System.out.println(String.format(
+                "GRANT %s ON TABLE %s TO ROLE %s;",
                 "*".equals(action) ? "ALL" : action.toUpperCase(), table,
-                roleName, server, database));
+                roleName));
 
             client.grantTablePrivilege(requestorUserName, roleName, server,
                 database, table, action);
           } else if (database != null && !AccessConstants.ALL.equals(database)) {
             System.out.println(String.format(
-                "GRANT %s ON DATABASE %s TO ROLE %s; # server=%s",
+                "# server=%s",
+                server));
+            System.out.println(String.format(
+                "GRANT %s ON DATABASE %s TO ROLE %s;",
                 "*".equals(action) ? "ALL" : action.toUpperCase(),
-                database, roleName, server));
+                database, roleName));
 
             client.grantDatabasePrivilege(requestorUserName, roleName, server,
                 database, action);


Mime
View raw message