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


##########
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:
   I think the behavior is to update the user with new roles, so user-level 
write lock is enough, no need to have a write lock for the user namespace, 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