jerqi commented on code in PR #5321:
URL: https://github.com/apache/gravitino/pull/5321#discussion_r1824083714


##########
core/src/main/java/org/apache/gravitino/hook/CatalogHookDispatcher.java:
##########
@@ -104,17 +104,30 @@ public Catalog createCatalog(
   @Override
   public Catalog alterCatalog(NameIdentifier ident, CatalogChange... changes)
       throws NoSuchCatalogException, IllegalArgumentException {
-    return dispatcher.alterCatalog(ident, changes);
+    Catalog alteredCatalog = dispatcher.alterCatalog(ident, changes);
+    CatalogChange.RenameCatalog lastRenameChange = null;
+    for (CatalogChange change : changes) {
+      if (change instanceof CatalogChange.RenameCatalog) {
+        lastRenameChange = (CatalogChange.RenameCatalog) change;
+      }
+    }
+    if (lastRenameChange != null) {
+      AuthorizationUtils.authorizationPluginRenamePrivileges(
+          ident, Entity.EntityType.CATALOG, lastRenameChange.getNewName());
+    }
+    return alteredCatalog;
   }
 
   @Override
   public boolean dropCatalog(NameIdentifier ident) {
+    AuthorizationUtils.authorizationPluginRemovePrivileges(ident, 
Entity.EntityType.CATALOG);
     return dispatcher.dropCatalog(ident);

Review Comment:
   OK.



-- 
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]

Reply via email to