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

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

                Author: ASF GitHub Bot
            Created on: 16/Jul/19 02:46
            Start Date: 16/Jul/19 02:46
    Worklog Time Spent: 10m 
      Work Description: hadoop-yetus commented on pull request #1101: 
HDDS-1544. Support default Acls for volume, bucket, keys and prefix. …
URL: https://github.com/apache/hadoop/pull/1101#discussion_r303709343
 
 

 ##########
 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:
[email protected]


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

    Worklog Id:     (was: 277134)
    Time Spent: 10h 20m  (was: 10h 10m)

> 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: Xiaoyu Yao
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HDDS-1544.00.patch
>
>          Time Spent: 10h 20m
>  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to