jerryshao commented on code in PR #5021:
URL: https://github.com/apache/gravitino/pull/5021#discussion_r1778423661


##########
core/src/main/java/org/apache/gravitino/authorization/PermissionManager.java:
##########
@@ -373,11 +376,174 @@ User revokeRolesFromUser(String metalake, List<String> 
roles, String user) {
     }
   }
 
-  private List<String> toRoleNames(List<RoleEntity> roleEntities) {
-    return 
roleEntities.stream().map(RoleEntity::name).collect(Collectors.toList());
+  Role grantPrivilegeToRole(
+      String metalake, String role, MetadataObject object, List<Privilege> 
privileges) {
+    try {
+      return store.update(
+          AuthorizationUtils.ofRole(metalake, role),
+          RoleEntity.class,
+          Entity.EntityType.ROLE,
+          roleEntity -> {
+            List<SecurableObject> securableObjects = 
roleEntity.securableObjects();
+
+            boolean objectExist = false;
+
+            List<SecurableObject> updateSecurableObjects = 
Lists.newArrayList();
+            // Only update the first matched securable object privilege

Review Comment:
   What's the meaning of this comment?



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