Skip to content

Commit

Permalink
fix refresh_privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
flaming-archer committed Apr 10, 2024
1 parent 1b9a36e commit 892d9c4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,14 @@ public GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilege
public GrantRevokePrivilegeResponse refresh_privileges(HiveObjectRef hiveObjectRef, String authorizer,
GrantRevokePrivilegeRequest grantRevokePrivilegeRequest) throws MetaException, TException {
DatabaseMapping databaseMapping = checkWritePermissions(hiveObjectRef.getDbName());
PrivilegeBag privilegeBag = grantRevokePrivilegeRequest.getPrivileges();
if (privilegeBag != null && privilegeBag.getPrivileges() != null) {
for (HiveObjectPrivilege hiveObjectPrivilege : privilegeBag.getPrivileges()) {
if (hiveObjectPrivilege.getHiveObject() != null) {
databaseMapping.transformInboundHiveObjectRef(hiveObjectPrivilege.getHiveObject());
}
}
}
return databaseMapping.getClient().refresh_privileges(databaseMapping.transformInboundHiveObjectRef(hiveObjectRef),
authorizer, grantRevokePrivilegeRequest);
}
Expand Down

0 comments on commit 892d9c4

Please sign in to comment.