ChenSammi commented on code in PR #4565:
URL: https://github.com/apache/ozone/pull/4565#discussion_r1172171882
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/acl/OzoneNativeAuthorizer.java:
##########
@@ -92,12 +91,24 @@ public boolean checkAccess(IOzoneObj ozObject,
RequestContext context)
}
// bypass all checks for admin
- boolean isAdmin = isAdmin(context.getClientUgi());
+ boolean isAdmin = isAdmin(ozAdmins, context.getClientUgi());
if (isAdmin) {
return true;
}
boolean isOwner = isOwner(context.getClientUgi(), context.getOwnerName());
+
+ boolean isReadOnlyAdmin = isAdmin(ozReadOnlyAdmins,
+ context.getClientUgi());
+
+ // bypass read checks for read only admin users
+ if (isReadOnlyAdmin
+ && (context.getAclRights() == ACLType.READ
+ || context.getAclRights() == ACLType.READ_ACL
+ || context.getAclRights() == ACLType.LIST)) {
+ return true;
+ }
Review Comment:
We can put the check before the isOwner statement.
--
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]