[ 
https://issues.apache.org/jira/browse/HDDS-1544?focusedWorklogId=275579&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-275579
 ]

ASF GitHub Bot logged work on HDDS-1544:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Jul/19 01:11
            Start Date: 12/Jul/19 01:11
    Worklog Time Spent: 10m 
      Work Description: hadoop-yetus commented on 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_r302796163
 
 

 ##########
 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 -> 
+        OzoneAcl.fromProtobuf(a)).collect(Collectors.toList()));
+    return acls;
+  }
+
+  private Collection<? extends OzoneAcl> getAccessAcls() {
+    List<OzoneAcl> acls = new ArrayList<>();
     for (OzoneAclType type : OzoneAclType.values()) {
-      aclMaps.get(type.ordinal()).entrySet().stream().
+      accessAclMap.get(type.ordinal()).entrySet().stream().
           forEach(entry -> acls.add(new OzoneAcl(ACLIdentityType.
-              valueOf(type.name()), entry.getKey(), entry.getValue())));
+              valueOf(type.name()), entry.getKey(), entry.getValue(),
+              OzoneAcl.AclScope.ACCESS)));
     }
+    
 
 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 275579)
    Time Spent: 3.5h  (was: 3h 20m)

> Support default Acls for volume, bucket, keys and prefix
> --------------------------------------------------------
>
>                 Key: HDDS-1544
>                 URL: https://issues.apache.org/jira/browse/HDDS-1544
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Ajay Kumar
>            Assignee: Ajay Kumar
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HDDS-1544.00.patch
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Add dAcls for volume, bucket, keys and prefix



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to