From 2be62900b3ec5bb0c2fda9a4d57edab50680b194 Mon Sep 17 00:00:00 2001 From: Ashish Singhi Date: Wed, 3 Dec 2014 17:22:28 +0530 Subject: [PATCH] HBASE-12601 Explain how to grant/revoke permission to a group/namespace in grant/revoke command usage --- hbase-shell/src/main/ruby/shell/commands/grant.rb | 5 ++++- hbase-shell/src/main/ruby/shell/commands/revoke.rb | 9 ++++++++- hbase-shell/src/main/ruby/shell/commands/user_permission.rb | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hbase-shell/src/main/ruby/shell/commands/grant.rb b/hbase-shell/src/main/ruby/shell/commands/grant.rb index e881baa..c9338f4 100644 --- a/hbase-shell/src/main/ruby/shell/commands/grant.rb +++ b/hbase-shell/src/main/ruby/shell/commands/grant.rb @@ -27,11 +27,14 @@ Syntax : grant [<@namespace> [ [ [ grant 'bobsmith', 'RWXCA' + hbase> grant '@admins', 'RWXCA' hbase> grant 'bobsmith', 'RWXCA', '@ns1' hbase> grant 'bobsmith', 'RW', 't1', 'f1', 'col1' hbase> grant 'bobsmith', 'RW', 'ns1:t1', 'f1', 'col1' diff --git a/hbase-shell/src/main/ruby/shell/commands/revoke.rb b/hbase-shell/src/main/ruby/shell/commands/revoke.rb index 57a2530..768989b 100644 --- a/hbase-shell/src/main/ruby/shell/commands/revoke.rb +++ b/hbase-shell/src/main/ruby/shell/commands/revoke.rb @@ -22,10 +22,17 @@ module Shell def help return <<-EOF Revoke a user's access rights. -Syntax : revoke [
[ []] +Syntax : revoke [<@namespace> [
[ []]]] + +Note: Groups and users access are revoked in the same way, but groups are prefixed with an '@' + character. In the same way, tables and namespaces are specified, but namespaces are + prefixed with an '@' character. + For example: hbase> revoke 'bobsmith' + hbase> revoke '@admins' + hbase> revoke 'bobsmith', '@ns1' hbase> revoke 'bobsmith', 't1', 'f1', 'col1' hbase> revoke 'bobsmith', 'ns1:t1', 'f1', 'col1' EOF diff --git a/hbase-shell/src/main/ruby/shell/commands/user_permission.rb b/hbase-shell/src/main/ruby/shell/commands/user_permission.rb index 5d8bf8a..e4673fc 100644 --- a/hbase-shell/src/main/ruby/shell/commands/user_permission.rb +++ b/hbase-shell/src/main/ruby/shell/commands/user_permission.rb @@ -23,9 +23,13 @@ module Shell return <<-EOF Show all permissions for the particular user. Syntax : user_permission
+ +Note: A namespace must always precede with '@' character. + For example: hbase> user_permission + hbase> user_permission '@ns1' hbase> user_permission 'table1' hbase> user_permission 'namespace1:table1' hbase> user_permission '.*' -- 1.9.2.msysgit.0