bharatviswa504 commented on a change in pull request #94: HDDS-2255. Improve 
Acl Handler Messages
URL: https://github.com/apache/hadoop-ozone/pull/94#discussion_r339823212
 
 

 ##########
 File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/ObjectStore.java
 ##########
 @@ -458,6 +458,23 @@ public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws 
IOException {
     return proxy.addAcl(obj, acl);
   }
 
+  /**
+   *
+   * @param obj Ozone object for which acl should be checked.
+   * @param acl ozone acl to be checked.
+   * @return true if acl exists in the obj, else false.
+   * @throws IOException if there is error.
+   */
+  public boolean checkAclExist(OzoneObj obj, OzoneAcl acl) throws IOException {
+    for (OzoneAcl existAcl : proxy.getAcl(obj)) {
+      if (existAcl.equals(acl)) {
 
 Review comment:
   This logic is not completely correct, take a case like USER1:RW, and we are 
trying to add USER1:R, the acl already exists. equals() will not work in this 
case. 

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