SetBucketAccessControlPolicy (SOAP API) - Amazon Simple Storage Service

SetBucketAccessControlPolicy (SOAP API)

Note

SOAP support over HTTP is deprecated, but it is still available over HTTPS. New Amazon S3 features will not be supported for SOAP. We recommend that you use either the REST API or the AWS SDKs.

The SetBucketAccessControlPolicy operation sets the Access Control Policy for an existing bucket. If successful, the previous Access Control Policy for the bucket is entirely replaced with the specified Access Control Policy.

Example

Give the specified user (usually the owner) FULL_CONTROL access to the "quotes" bucket.

Sample Request

<SetBucketAccessControlPolicy xmlns="http://doc.s3.amazonaws.com/2006-03-01"> <Bucket>quotes</Bucket> <AccessControlList> <Grant> <Grantee xsi:type="CanonicalUser"> <ID>a9a7b8863000e241bf9b1c61be666e9</ID> <DisplayName>chriscustomer</DisplayName> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> </AccessControlList> <AWSAccessKeyId>AKIAIOSFODNN7EXAMPLE</AWSAccessKeyId> <Timestamp>2006-03-01T12:00:00.183Z</Timestamp> <Signature>Iuyz3d3P0aTou39dzbqaEXAMPLE=</Signature> </SetBucketAccessControlPolicy >

Sample Response

<GetBucketAccessControlPolicyResponse xmlns="http://s3.amazonaws.com/doc/2006-03-01"> <GetBucketAccessControlPolicyResponse> <Code>200</Code> <Description>OK</Description> </GetBucketAccessControlPolicyResponse> </GetBucketAccessControlPolicyResponse>

Access Control

You must have WRITE_ACP rights to the bucket in order to set the access control policy for a bucket.