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


##########
server/src/main/java/org/apache/gravitino/server/web/rest/PermissionOperations.java:
##########
@@ -65,11 +69,19 @@ public Response grantRolesToUser(
       return Utils.doAs(
           httpRequest,
           () ->
-              Utils.ok(
-                  new UserResponse(
-                      DTOConverters.toDTO(
-                          accessControlManager.grantRolesToUser(
-                              metalake, request.getRoleNames(), user)))));
+              TreeLockUtils.doWithTreeLock(
+                  
NameIdentifier.of(AuthorizationUtils.ofUserNamespace(metalake).levels()),

Review Comment:
   Yes, it's enough for this case. I just want to follow the other lock style. 
It's a little weird that some write operations use parent write lock and some 
write operations use self write lock.  
   It's ok to modify here.



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