flyrain commented on code in PR #3852:
URL: https://github.com/apache/polaris/pull/3852#discussion_r2984450343


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -2335,4 +2354,195 @@ private static PolarisEntitySubType 
selectEntitySubType(List<PolarisEntitySubTyp
               subTypes));
     }
   }
+
+  /**
+   * Grants the catalog_role_manager principal role to all principals assigned 
to the specified
+   * principal role. This allows catalog admins to list principal roles.
+   */
+  private void grantCatalogRoleManagerIfNeeded(PrincipalRoleEntity 
principalRoleEntity) {
+    // Load catalog_role_manager directly from metastore
+    EntityResult catalogRoleManagerResult =
+        metaStoreManager.readEntityByName(
+            getCurrentPolarisContext(),
+            null,
+            PolarisEntityType.PRINCIPAL_ROLE,
+            PolarisEntitySubType.NULL_SUBTYPE,
+            PolarisEntityConstants.getNameOfCatalogRoleManagerPrincipalRole());
+
+    if (!catalogRoleManagerResult.isSuccess() || 
catalogRoleManagerResult.getEntity() == null) {
+      return;

Review Comment:
   Do we provide a way to re-bootstrap? AuthBootstrapUtil (line 56-61) 
basically prevents re-bootstrap. I think we need to figure out a way for 
upgrade from existing realm. Throwing an error there isn't enough.



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