hadoop-yetus commented on a change in pull request #1074: HDDS-1544. Support
default Acls for volume, bucket, keys and prefix. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/1074#discussion_r302796170
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/utils/OzoneUtils.java
##########
@@ -365,4 +369,29 @@ public static boolean checkIfAclBitIsSet(ACLType acl,
BitSet bitset) {
|| bitset.get(ALL.ordinal()))
&& !bitset.get(NONE.ordinal()));
}
+
+ /**
+ * Helper function to find and return all DEFAULT acls in input list with
+ * scope changed to ACCESS.
+ * @param acls
+ *
+ * @return list of default Acls.
+ * */
+ public static Collection<OzoneAclInfo> getDefaultAclsProto(List<OzoneAcl>
acls) {
+ return acls.stream().filter(a -> a.getAclScope() == DEFAULT)
+ .map(OzoneAcl::toProtobufWithAccessType).collect(Collectors.toList());
+ }
+
+ /**
+ * Helper function to find and return all DEFAULT acls in input list with
+ * scope changed to ACCESS.
+ * @param acls
+ *
+ * @return list of default Acls.
+ * */
+ public static Collection<OzoneAcl> getDefaultAcls(List<OzoneAcl> acls) {
+ return acls.stream().filter(a -> a.getAclScope() == DEFAULT)
+ .collect(Collectors.toList());
+ }
+
Review comment:
whitespace:end of line
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]