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


##########
core/src/main/java/org/apache/gravitino/authorization/AuthorizationUtils.java:
##########
@@ -150,29 +150,46 @@ public static void callAuthorizationPlugin(
       if (needApplyAllAuthorizationPlugin(securableObject)) {
         Catalog[] catalogs = 
catalogManager.listCatalogsInfo(Namespace.of(metalake));
         for (Catalog catalog : catalogs) {
-          callAuthorizationPluginImpl(catalogsAlreadySet, consumer, catalog);
+          callAuthorizationPluginImpl(consumer, catalog);
         }
 
       } else if (supportsSingleAuthorizationPlugin(securableObject.type())) {
         NameIdentifier catalogIdent =
             NameIdentifierUtil.getCatalogIdentifier(
                 MetadataObjectUtil.toEntityIdent(metalake, securableObject));
         Catalog catalog = catalogManager.loadCatalog(catalogIdent);
-        callAuthorizationPluginImpl(catalogsAlreadySet, consumer, catalog);
+        if (!catalogsAlreadySet.contains(catalog.name())) {
+          catalogsAlreadySet.add(catalog.name());
+          callAuthorizationPluginImpl(consumer, catalog);
+        }
+      }
+    }
+  }
+
+  public static void callAuthorizationPluginForMetadataObject(
+      String metalake, MetadataObject metadataObject, 
Consumer<AuthorizationPlugin> consumer) {
+    CatalogManager catalogManager = 
GravitinoEnv.getInstance().catalogManager();
+    if (needApplyAuthorizationPluginSetOwner(metadataObject.type())) {

Review Comment:
   I changed to `needApplyAllAuthorizationPlugin`



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