FANNG1 commented on code in PR #6746:
URL: https://github.com/apache/gravitino/pull/6746#discussion_r2020490367
##########
core/src/main/java/org/apache/gravitino/listener/api/event/GrantUserRolesEvent.java:
##########
@@ -42,7 +45,7 @@ public GrantUserRolesEvent(
super(initiator, NameIdentifierUtil.ofUser(metalake,
grantUserInfo.name()));
this.grantUserInfo = grantUserInfo;
- this.roles = roles;
+ this.roles = ImmutableList.copyOf(roles);
Review Comment:
Should we add a nullable check before copy?
##########
core/src/main/java/org/apache/gravitino/listener/api/event/GrantUserRolesPreEvent.java:
##########
@@ -41,7 +44,7 @@ protected GrantUserRolesPreEvent(
super(initiator, NameIdentifierUtil.ofUser(metalake, userName));
this.userName = userName;
- this.roles = roles;
+ this.roles = ImmutableList.copyOf(roles);
Review Comment:
no need to make roles immutable in pre event, as one of the purpose of the
pre event is to allow user to change the request.
--
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]