HonahX commented on code in PR #1416:
URL: https://github.com/apache/polaris/pull/1416#discussion_r2052833731
##########
service/common/src/main/java/org/apache/polaris/service/catalog/policy/PolicyCatalogHandler.java:
##########
@@ -141,4 +160,106 @@ private void authorizeBasicPolicyOperationOrThrow(
initializeCatalog();
}
+
+ private void authorizePolicyAttachmentOperationOrThrow(
+ PolicyIdentifier identifier, PolicyAttachmentTarget target, boolean
isAttach) {
+ resolutionManifest =
+ entityManager.prepareResolutionManifest(callContext, securityContext,
catalogName);
+ resolutionManifest.addPassthroughPath(
+ new ResolverPath(
+ PolarisCatalogHelpers.identifierToList(identifier.getNamespace(),
identifier.getName()),
+ PolarisEntityType.POLICY,
+ true /* optional */),
+ identifier);
+
+ switch (target.getType()) {
Review Comment:
Yes, currently policy can only be attached to `catalog`, `namespace`,
`table` (in the initial version, iceberg tables only).
Thanks for catching this, added the `default` case.
--
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]