sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject [09/12] sentry git commit: move group commands to top level.
Date Tue, 24 Jan 2017 23:03:31 GMT
move group commands to top level.


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

Branch: refs/heads/akolb-ha-cli
Commit: fec2f86c913d414651c5468983a0e66fb6bc8db4
Parents: 861ba6f
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Mon Dec 12 18:36:44 2016 -0800
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Sun Jan 22 17:09:07 2017 -0800

----------------------------------------------------------------------
 .../org/apache/sentry/shell/TopLevelShell.java  | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/fec2f86c/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
----------------------------------------------------------------------
diff --git a/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java b/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
index c1d8a77..b2b7e8d 100644
--- a/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
+++ b/sentry-tools/src/main/java/org/apache/sentry/shell/TopLevelShell.java
@@ -77,6 +77,31 @@ public class TopLevelShell implements ShellDependent, Runnable {
         return tools.listGroupRoles();
     }
 
+    @Command(description = "Grant role to groups")
+    public void grantRole(String roleName, String ...groups) {
+        tools.grantGroupsToRole(roleName, groups);
+    }
+
+    @Command(abbrev = "grm",
+            description = "Revoke role from groups")
+    public void revokeRole(String roleName, String ...groups) {
+        tools.revokeGroupsFromRole(roleName, groups);
+    }
+
+    @Command(description = "Create Sentry role(s).")
+    public void createRole(
+            @Param(name = "roleName", description = "name of role to create")
+                    String ...roles) {
+        tools.createRoles(roles);
+    }
+
+    @Command(abbrev = "rm", description = "remove Sentry role(s).")
+    public void removeRole(
+            @Param(name = "roleName ...", description = "role names to remove")
+                    String ...roles) {
+        tools.removeRoles(roles);
+    }
+
     @Override
     public void cliSetShell(Shell theShell) {
         this.shell = theShell;


Mime
View raw message