Galsza commented on code in PR #3693:
URL: https://github.com/apache/ozone/pull/3693#discussion_r949997558
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/DBCheckpointServlet.java:
##########
@@ -92,7 +97,8 @@ private boolean hasPermission(UserGroupInformation user) {
if (aclEnabled && isSpnegoEnabled) {
return allowedUsers.contains(OZONE_ADMINISTRATORS_WILDCARD)
|| allowedUsers.contains(user.getShortUserName())
- || allowedUsers.contains(user.getUserName());
+ || allowedUsers.contains(user.getUserName())
+ || !Sets.intersection(new HashSet<>(allowedGroups), new
HashSet<>(user.getGroups())).isEmpty();
Review Comment:
Nit: I kinda wish the `Sets.intersection(new HashSet<>(allowedGroups), new
HashSet<>(user.getGroups())).isEmpty()` could be extracted to a small helper
method like `isUserInAdminGroup` to decrease cognitive load when looking at the
whole boolean expression. It's up to your preference.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]