HonahX commented on code in PR #2697:
URL: https://github.com/apache/polaris/pull/2697#discussion_r2388748812
##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -259,12 +267,15 @@ protected void authorizeBasicTableLikeOperationOrThrow(
if (target == null) {
throwNotFoundExceptionForTableLikeEntity(identifier, List.of(subType));
}
- authorizer.authorizeOrThrow(
- polarisPrincipal,
- resolutionManifest.getAllActivatedCatalogRoleAndPrincipalRoles(),
- op,
- target,
- null /* secondary */);
+
+ for (PolarisAuthorizableOperation op : ops) {
+ authorizer.authorizeOrThrow(
+ polarisPrincipal,
+ resolutionManifest.getAllActivatedCatalogRoleAndPrincipalRoles(),
+ op,
+ target,
+ null /* secondary */);
+ }
Review Comment:
Maybe this can be a follow-up discussion since it's about adding an
interface method and does not need to block this PR.
But I think ultimately we need the new api to authorize a batch of
operations. There is a recent effort to introduce
`OpaAuthorizer`(https://github.com/apache/polaris/pull/2680) that need to make
rest call for each `authorizeOrThrow` to contact remote privilege/policy agent.
It'd better to avoid multiple REST calls given that one iceberg commit usually
contains many update types. (especially when CTAS)
--
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]