bharatviswa504 commented on issue #94: HDDS-2255. Improve Acl Handler Messages
URL: https://github.com/apache/hadoop-ozone/pull/94#issuecomment-548421656
 
 
   > Thanks @bharatviswa504 for the comment.
   > 
   > `RemoveAclHandler` updated.
   > 
   > And I found that
   > 
   > `ozone sh vol setacl --acls=user:newUser:wr,user:newUser:w,user:newUser:r 
/vol` will return `false` for the already existed acl.
   > 
   > `ozone sh bucket setacl 
--acls=user:newUser:wr,user:newUser:w,user:newUser:r /vol/buc` will return 
`true`
   > 
   > `ozone sh key setacl --acls=user:newUser:wr,user:newUser:w,user:newUser:r 
/vol/buc/ikey` will return `true`
   > 
   > So we update the `SetAclVolumeHandler`.
   > 
   > Could we fix the `SetAclBucketHandler#setAcl()` & 
`SetAclKeyHandler#setAcl()` to show the right message for the existed acl ?
   
   OzoneAclUtil.java
   ```
    public static boolean setAcl(List<OzoneAcl> existingAcls,
         List<OzoneAcl> newAcls) {
       if (existingAcls == null) {
         return false;
       } else {
         existingAcls.clear();
         if (newAcls != null) {
           existingAcls.addAll(newAcls);
         }
       }
       return true;
     }
   ```
   
   setAcl logic used by Bucket/Volume/Key SetAcl. if new Acls are being set we 
just override and return true.  and top existingAcls == null will mostly not 
happen, as we set in builder like below.
   
   OmBucketInfo.java L256:
   ```
       public Builder() {
         //Default values
         this.acls = new ArrayList<>();
         this.isVersionEnabled = false;
         this.storageType = StorageType.DISK;
         this.metadata = new HashMap<>();
       }
   ```

----------------------------------------------------------------
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


With regards,
Apache Git Services

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

Reply via email to