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 <[email protected]> Authored: Mon Dec 12 18:36:44 2016 -0800 Committer: Alexander Kolbasov <[email protected]> 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;
