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


##########
core/src/main/java/org/apache/gravitino/authorization/PermissionManager.java:
##########
@@ -81,6 +86,15 @@ User grantRolesToUser(String metalake, List<String> roles, 
String user) {
               UserEntity.class,
               Entity.EntityType.USER,
               userEntity -> {
+                if (store instanceof EntityCache relationalStore) {
+                  roles.forEach(
+                          roleName -> {
+                            Namespace namespaceRole = 
NamespaceUtil.ofRole(metalake);
+                            NameIdentifier nameIdentifierRole = 
NameIdentifier.of(namespaceRole, roleName);
+                            relationalStore.invalidate(nameIdentifierRole, 
Entity.EntityType.ROLE);

Review Comment:
   Maybe we need an interface to invalidate user and all the roles.



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