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_r302796158
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmOzoneAclMap.java
##########
@@ -49,53 +52,71 @@
@SuppressWarnings("ProtocolBufferOrdinal")
public class OmOzoneAclMap {
// per Acl Type user:rights map
- private ArrayList<Map<String, BitSet>> aclMaps;
+ private ArrayList<Map<String, BitSet>> accessAclMap;
+ private List<OzoneAclInfo> defaultAclList;
OmOzoneAclMap() {
- aclMaps = new ArrayList<>();
+ accessAclMap = new ArrayList<>();
+ defaultAclList = new ArrayList<>();
for (OzoneAclType aclType : OzoneAclType.values()) {
- aclMaps.add(aclType.ordinal(), new HashMap<>());
+ accessAclMap.add(aclType.ordinal(), new HashMap<>());
}
}
- private Map<String, BitSet> getMap(OzoneAclType type) {
- return aclMaps.get(type.ordinal());
+ private Map<String, BitSet> getAccessAclMap(OzoneAclType type) {
+ return accessAclMap.get(type.ordinal());
}
// For a given acl type and user, get the stored acl
private BitSet getAcl(OzoneAclType type, String user) {
- return getMap(type).get(user);
+ return getAccessAclMap(type).get(user);
}
public List<OzoneAcl> getAcl() {
List<OzoneAcl> acls = new ArrayList<>();
+ acls.addAll(getAccessAcls());
+ acls.addAll(defaultAclList.stream().map(a ->
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]