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_r302796231
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
##########
@@ -983,6 +1019,48 @@ public OmMultipartInfo
applyInitiateMultipartUpload(OmKeyArgs keyArgs,
}
}
+ private List<OzoneAclInfo> getAclsForKey(OmKeyArgs keyArgs,
+ OmVolumeArgs volArgs, OmBucketInfo bucketInfo) {
+ List<OzoneAclInfo> acls = new ArrayList<>(keyArgs.getAcls().size());
+
+ keyArgs.getAcls().stream().map(OzoneAcl::toProtobuf).
+ collect(Collectors.toList());
+
+// if(volArgs != null) {
+// acls.addAll(volArgs.getAclMap().getDefaultAclList());
+// }
+
+ // Inherit DEFAULT acls from prefix.
+ boolean prefixParentFound = false;
+ if(prefixManager != null) {
+ List<OmPrefixInfo> prefixList = prefixManager.getLongestPrefixPath(
+ OZONE_URI_DELIMITER +
+ keyArgs.getVolumeName() + OZONE_URI_DELIMITER +
+ keyArgs.getBucketName() + OZONE_URI_DELIMITER +
+ keyArgs.getKeyName());
+
+ if(prefixList.size() > 0) {
+ // Add all acls from direct parent to key.
+ OmPrefixInfo prefixInfo = prefixList.get(prefixList.size() - 1);
+ if(prefixInfo != null) {
+ acls.addAll(OzoneUtils.getDefaultAclsProto(prefixInfo.getAcls()));
+ prefixParentFound = true;
+ }
+ }
+ }
+
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]