jerqi commented on code in PR #6045:
URL: https://github.com/apache/gravitino/pull/6045#discussion_r1900832252
##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -255,15 +245,33 @@ public static void authorizationPluginRemovePrivileges(
if (GravitinoEnv.getInstance().accessControlDispatcher() != null) {
MetadataObject metadataObject =
NameIdentifierUtil.toMetadataObject(ident, type);
MetadataObjectChange removeObject =
MetadataObjectChange.remove(metadataObject);
+
+ String metalake =
+ type == Entity.EntityType.METALAKE ? ident.name() :
ident.namespace().level(0);
+
callAuthorizationPluginForMetadataObject(
- ident.namespace().level(0),
+ metalake,
metadataObject,
authorizationPlugin -> {
authorizationPlugin.onMetadataUpdated(removeObject);
});
}
}
+ public static void removeCatalogPrivileges(Catalog catalog) {
Review Comment:
I prefer putting the logic into `AuthorizationUtils`.
`callAuthorizationPluginImpl` is a private implement method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]