hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (HDDS-1544) Support default Acls for volume, bucket, keys and prefix
Date Tue, 16 Jul 2019 02:47:01 GMT

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

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_r303709318
 
 

 ##########
 File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java
 ##########
 @@ -178,19 +204,55 @@ public static OzoneAclInfo toProtobuf(OzoneAcl acl) {
     OzoneAclInfo.Builder builder = OzoneAclInfo.newBuilder()
         .setName(acl.getName())
         .setType(OzoneAclType.valueOf(acl.getType().name()))
+        .setAclScope(OzoneAclScope.valueOf(acl.getAclScope().name()))
         .setRights(ByteString.copyFrom(acl.getAclBitSet().toByteArray()));
     return builder.build();
   }
 
   public static OzoneAcl fromProtobuf(OzoneAclInfo protoAcl) {
     BitSet aclRights = BitSet.valueOf(protoAcl.getRights().toByteArray());
     return new OzoneAcl(ACLIdentityType.valueOf(protoAcl.getType().name()),
-        protoAcl.getName(), aclRights);
+        protoAcl.getName(), aclRights, 
+        AclScope.valueOf(protoAcl.getAclScope().name()));
+  }
+
+  /**
+   * Helper function to convert a proto message of type {@link OzoneAclInfo}
+   * to {@link OzoneAcl} with acl scope of type ACCESS.
+   * 
+   * @param protoAcl
+   * @return OzoneAcl
+   * */
+  public static OzoneAcl fromProtobufWithAccessType(OzoneAclInfo protoAcl) {
+    BitSet aclRights = BitSet.valueOf(protoAcl.getRights().toByteArray());
+    return new OzoneAcl(ACLIdentityType.valueOf(protoAcl.getType().name()),
+        protoAcl.getName(), aclRights, AclScope.ACCESS);
+  }
+
+  /**
+   * Helper function to convert an {@link OzoneAcl} to proto message of type
+   * {@link OzoneAclInfo} with acl scope of type ACCESS.
+   *
+   * @param acl
+   * @return OzoneAclInfo
+   * */
+  public static OzoneAclInfo toProtobufWithAccessType(OzoneAcl acl) {
+    OzoneAclInfo.Builder builder = OzoneAclInfo.newBuilder()
+        .setName(acl.getName())
+        .setType(OzoneAclType.valueOf(acl.getType().name()))
+        .setAclScope(OzoneAclScope.ACCESS)
+        .setRights(ByteString.copyFrom(acl.getAclBitSet().toByteArray()));
+    return builder.build();
   }
 
+  public AclScope getAclScope() {
+    return aclScope;
+  }
+  
   @Override
   public String toString() {
-    return type + ":" + name + ":" + ACLType.getACLString(aclBitSet);
+    return type + ":" + name + ":" + ACLType.getACLString(aclBitSet) 
 
 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:
users@infra.apache.org


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

    Worklog Id:     (was: 277130)
    Time Spent: 9h 40m  (was: 9.5h)

> 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: 9h 40m
>  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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message