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)
150
150
if !table_regex . nil? && isNamespace? ( table_regex )
151
151
nsPerm = permission . to_java ( org . apache . hadoop . hbase . security . access . NamespacePermission )
152
152
namespace = nsPerm . getNamespace
153
- elsif !table_regex . nil?
153
+ elsif !table_regex . nil? && isTablePermission? ( permission )
154
154
tblPerm = permission . to_java ( org . apache . hadoop . hbase . security . access . TablePermission )
155
155
namespace = tblPerm . getNamespace
156
156
table = !tblPerm . getTableName . nil? ? tblPerm . getTableName . getNameAsString : ''
@@ -183,6 +183,10 @@ def isNamespace?(table_name)
183
183
table_name . start_with? ( '@' )
184
184
end
185
185
186
+ def isTablePermission? ( permission )
187
+ permission . java_kind_of? ( org . apache . hadoop . hbase . security . access . TablePermission )
188
+ end
189
+
186
190
# Does Namespace exist
187
191
def namespace_exists? ( namespace_name )
188
192
return !@admin . getNamespaceDescriptor ( namespace_name ) . nil?
Original file line number Diff line number Diff line change @@ -91,6 +91,15 @@ def teardown
91
91
end
92
92
assert ( found_permission , 'Permission for user ' + global_user_name + ' was not found.' )
93
93
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
+
94
103
found_permission = false
95
104
security_admin . revoke ( global_user_name )
96
105
security_admin . user_permission do |user , _ |
You can’t perform that action at this time.
0 commit comments