dimas-b commented on code in PR #3852:
URL: https://github.com/apache/polaris/pull/3852#discussion_r2983661300


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -1518,8 +1569,17 @@ public PrivilegeResult assignCatalogRoleToPrincipalRole(
     CatalogEntity catalogEntity = getCatalogByName(resolutionManifest, 
catalogName);
     CatalogRoleEntity catalogRoleEntity = 
getCatalogRoleByName(resolutionManifest, catalogRoleName);
 
-    return metaStoreManager.grantUsageOnRoleToGrantee(
-        getCurrentPolarisContext(), catalogEntity, catalogRoleEntity, 
principalRoleEntity);
+    PrivilegeResult result =
+        metaStoreManager.grantUsageOnRoleToGrantee(
+            getCurrentPolarisContext(), catalogEntity, catalogRoleEntity, 
principalRoleEntity);
+
+    // if granting catalog_admin, also grant catalog_role_manager to allow 
listing principal roles
+    if (result.isSuccess()
+        && 
PolarisEntityConstants.getNameOfCatalogAdminRole().equals(catalogRoleName)) {
+      grantCatalogRoleManagerIfNeeded(principalRoleEntity);

Review Comment:
   The role named `catalog_admin` may exist in every catalog, but conceptually 
it is scoped down to each catalog individually. However, Principals are global 
to the realm. So automatically exposing principal role listing to every catalog 
admin sounds like an overreach to me... WDYT?



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