File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ def user_permission(table_regex = nil)
150150 if !table_regex . nil? && isNamespace? ( table_regex )
151151 nsPerm = permission . to_java ( org . apache . hadoop . hbase . security . access . NamespacePermission )
152152 namespace = nsPerm . getNamespace
153- elsif !table_regex . nil?
153+ elsif !table_regex . nil? && isTablePermission? ( permission )
154154 tblPerm = permission . to_java ( org . apache . hadoop . hbase . security . access . TablePermission )
155155 namespace = tblPerm . getNamespace
156156 table = !tblPerm . getTableName . nil? ? tblPerm . getTableName . getNameAsString : ''
@@ -183,6 +183,10 @@ def isNamespace?(table_name)
183183 table_name . start_with? ( '@' )
184184 end
185185
186+ def isTablePermission? ( permission )
187+ permission . java_kind_of? ( org . apache . hadoop . hbase . security . access . TablePermission )
188+ end
189+
186190 # Does Namespace exist
187191 def namespace_exists? ( namespace_name )
188192 return !@admin . getNamespaceDescriptor ( namespace_name ) . nil?
Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ def teardown
9191 end
9292 assert ( found_permission , 'Permission for user ' + global_user_name + ' was not found.' )
9393
94+ found_permission = false
95+ security_admin . user_permission ( '.*' ) do |user , permission |
96+ if user == global_user_name
97+ assert_match ( /WRITE/ , permission . to_s )
98+ found_permission = true
99+ end
100+ end
101+ assert ( found_permission , 'Permission for user ' + global_user_name + ' was not found.' )
102+
94103 found_permission = false
95104 security_admin . revoke ( global_user_name )
96105 security_admin . user_permission do |user , _ |
You can’t perform that action at this time.
0 commit comments