You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/10/28 22:34:16 UTC

[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #94: HDDS-2255. Improve Acl Handler Messages

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:
users@infra.apache.org


With regards,
Apache Git Services

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