HBASE-11044 [Shell] Show groups for user in 'whoami' output
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1588945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3511399ca7
commit
bdc2d1f831
|
@ -30,7 +30,12 @@ EOF
|
|||
end
|
||||
|
||||
def command()
|
||||
puts "#{org.apache.hadoop.hbase.security.User.getCurrent().toString()}"
|
||||
user = org.apache.hadoop.hbase.security.User.getCurrent()
|
||||
puts "#{user.toString()}"
|
||||
groups = user.getGroupNames().to_a
|
||||
if not groups.nil? and groups.length > 0
|
||||
puts " groups: #{groups.join(', ')}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue