jerqi commented on code in PR #6045:
URL: https://github.com/apache/gravitino/pull/6045#discussion_r1905042151
##########
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 similar logic to one place. It's better to maintain the
code.
I don't preferring expose more implement methods to other package.
Other similar logic are in the class AuthorizationUtils.
--
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]