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


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/RoleMetaService.java:
##########
@@ -291,11 +259,49 @@ public int deleteRoleMetasByLegacyTimeline(long 
legacyTimeline, int limit) {
         + securableObjectsCount[0];
   }
 
-  private MetadataObject.Type getType(String type) {
+  private static List<SecurableObject> listSecurableObjects(RolePO po) {
+    List<SecurableObjectPO> securableObjectPOs = 
listSecurableObjectsByRoleId(po.getRoleId());
+    List<SecurableObject> securableObjects = Lists.newArrayList();
+
+    for (SecurableObjectPO securableObjectPO : securableObjectPOs) {
+      String fullName =
+          MetadataObjectService.getMetadataObjectFullName(
+              securableObjectPO.getType(), 
securableObjectPO.getMetadataObjectId());
+      if (fullName != null) {
+        securableObjects.add(
+            POConverters.fromSecurableObjectPO(
+                fullName, securableObjectPO, 
getType(securableObjectPO.getType())));
+      } else {
+        LOG.info(

Review Comment:
   > Besides, looks like if the object is deleted, then we will always get null 
result, maybe we should also delete the relation to role when we delete the 
object.
   
   I have created an issue https://github.com/apache/gravitino/issues/5029 to 
track it.



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