ASF GitHub Bot logged work on HDDS-1768:

                Author: ASF GitHub Bot
            Created on: 08/Aug/19 03:48
            Start Date: 08/Aug/19 03:48
    Worklog Time Spent: 10m 
      Work Description: dineshchitlangia commented on pull request #1204: 
HDDS-1768. Audit xxxAcl methods in OzoneManager
URL: https://github.com/apache/hadoop/pull/1204#discussion_r311846099

 File path: 
 @@ -3029,24 +3044,39 @@ public boolean addAcl(OzoneObj obj, OzoneAcl acl) 
throws IOException {
   public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
-    if(isAclEnabled) {
-      checkAcls(obj.getResourceType(), obj.getStoreType(), ACLType.WRITE_ACL,
-          obj.getVolumeName(), obj.getBucketName(), obj.getKeyName());
-    }
-    // TODO: Audit ACL operation.
-    switch (obj.getResourceType()) {
-    case VOLUME:
-      return volumeManager.removeAcl(obj, acl);
-    case BUCKET:
-      return bucketManager.removeAcl(obj, acl);
-    case KEY:
-      return keyManager.removeAcl(obj, acl);
-    case PREFIX:
-      return prefixManager.removeAcl(obj, acl);
+    Map<String, String> auditMap = obj.toAuditMap();
+    auditMap.put(OzoneConsts.ACLS, acl.toString());
 Review comment:
   @bharatviswa504 I actually spotted a typo because of your comment.
   removeAcl & addAcl will use `auditMap.put(OzoneConsts.ACL, acl.toString())`
   setAcl will use `auditMap.put(OzoneConsts.ACLS, acls.toString())`
   getAcl will not have such a line.
   The difference between first 2 is that setAcl can have more than one Acl in 
question hence using 'ACLS' to indicate multiple.
   Let me know if you think we still need to move this line to common method 
and avoid such detailed classification.
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:

Issue Time Tracking

    Worklog Id:     (was: 290976)
    Time Spent: 1h 40m  (was: 1.5h)

> Audit xxxAcl methods in OzoneManager
> ------------------------------------
>                 Key: HDDS-1768
>                 URL: https://issues.apache.org/jira/browse/HDDS-1768
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Ajay Kumar
>            Assignee: Dinesh Chitlangia
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
> Audit permission failures from authorizer

This message was sent by Atlassian JIRA

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

Reply via email to