]> git.apps.os.sepia.ceph.com Git - s3-tests.git/commitdiff
test put_bucket_acl with group uri 635/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 26 Mar 2025 20:10:14 +0000 (16:10 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 26 Mar 2025 20:10:14 +0000 (16:10 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
s3tests_boto3/functional/test_s3.py

index b01a47c5238ccdb5d246fa2ce5d57e475c06e1e6..b9b579891a974a290c053130a184f5ea2173b409 100644 (file)
@@ -4068,6 +4068,41 @@ def test_bucket_acl_canned_authenticatedread():
             ],
         )
 
+def test_put_bucket_acl_grant_group_read():
+    bucket_name = get_new_bucket()
+    client = get_client()
+    display_name = get_main_display_name()
+    user_id = get_main_user_id()
+
+    grant = {'Grantee': {'Type': 'Group', 'URI': 'http://acs.amazonaws.com/groups/global/AllUsers'}, 'Permission': 'READ'}
+    policy = add_bucket_user_grant(bucket_name, grant)
+
+    client.put_bucket_acl(Bucket=bucket_name, AccessControlPolicy=policy)
+
+    response = client.get_bucket_acl(Bucket=bucket_name)
+
+    check_grants(
+        response['Grants'],
+        [
+            dict(
+                Permission='READ',
+                ID=None,
+                DisplayName=None,
+                URI='http://acs.amazonaws.com/groups/global/AllUsers',
+                EmailAddress=None,
+                Type='Group',
+                ),
+            dict(
+                Permission='FULL_CONTROL',
+                ID=user_id,
+                DisplayName=display_name,
+                URI=None,
+                EmailAddress=None,
+                Type='CanonicalUser',
+                ),
+            ],
+        )
+
 def test_object_acl_default():
     bucket_name = get_new_bucket()
     client = get_client()