sumitagrawl commented on code in PR #4439:
URL: https://github.com/apache/ozone/pull/4439#discussion_r1146306658


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketSetPropertyRequest.java:
##########
@@ -269,6 +268,26 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
     }
   }
 
+  private void checkAclPermission(
+      OzoneManager ozoneManager, String volumeName, String bucketName)
+      throws IOException {
+    if (ozoneManager.getOmMetadataReader().isNativeAuthorizerEnabled()) {
+      UserGroupInformation ugi = createUGI();
+      String bucketOwner = ozoneManager.getBucketOwner(volumeName, bucketName,
+          IAccessAuthorizer.ACLType.READ, OzoneObj.ResourceType.BUCKET);
+      if (!ozoneManager.isAdmin(ugi) &&
+          !ozoneManager.isOwner(ugi, bucketOwner)) {
+        throw new OMException(
+            "Only bucket owners and Ozone admins can set Bucket property",

Review Comment:
   @ChenSammi Updated



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/acl/OzoneNativeAuthorizer.java:
##########
@@ -104,34 +106,45 @@ public boolean checkAccess(IOzoneObj ozObject, 
RequestContext context)
     // Refined the parent context
     // OP         |CHILD       |PARENT
 
-    // CREATE      NONE         WRITE     (parent:'CREATE' when 'create 
bucket')
-    // DELETE      DELETE       WRITE
-    // WRITE       WRITE        WRITE
-    // WRITE_ACL   WRITE_ACL    WRITE     (V1 WRITE_ACL=>WRITE)
+    // CREATE      NONE        WRITE     (parent:'CREATE' when 'create bucket')

Review Comment:
   @ChenSammi Updated



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to