PUT Bucket acl

Sets the access control list (ACL) permissions for an existing bucket. You cannot set ACL permissions if you do not have WRITE_ACP permission for a bucket.

Use the x-amz-acl request header to set ACL permissions for a bucket at creation time.

Request syntax

PUT /?acl HTTP/1.1
Host: BucketName.rs2.StorageService.com
Date: date
Authorization: signatureValue

<AccessControlPolicy>
  <Owner>
    <ID>ID</ID>
    <DisplayName>EmailAddress</DisplayName>
  </Owner>
  <AccessControlList>
    <Grant>
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
        [ <URI>URI</URI> | <ID>ID</ID> | <DisplayName>EmailAddress</DisplayName> ]
      </Grantee>
      <Permission>Permission</Permission>
    </Grant>
  </AccessControlList>
</AccessControlPolicy> 

Request headers

The PUT Bucket acl operation accepts the following request headers:
Authorization, Content-Length, Content-Type, Date, and Host.

The Authorization, Date, and Host headers are required; the others are optional.
For more information, see Request Headers.

Request elements

The PUT Bucket acl operation can set the following items (item datatypes in parentheses):

Response headers

The PUT Bucket acl operation may include the following response headers: Content-Length, Connection, Date, ETag, and Server.
For more information, see Response Headers.

Examples

This request grants read permission to all users and full control to the "documentation" bucket owner.

Request sample
PUT /documentation/?acl HTTP/1.1
Content-Length: 619
Content-Type: text/plain
Date: Thu, 16 Jun 2011 15:46:10 GMT
Authorization: AWS pat:/nkzkbitg6LW/p0IxMSaJie4ELc=
Host: demo.cloud.it

<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Owner>
    <ID>3452783832C94517345278000000004000000120</ID>
    <DisplayName>Patrick</DisplayName>
  </Owner>
  <AccessControlList>
    <Grant>
      <Grantee xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
        <URI>http://acs.amazonaws.com/groups/global/AllUsers</URI>
      </Grantee>
      <Permission>READ</Permission>
    </Grant>
    <Grant>
      <Grantee xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
        <ID>3452783832C94517345278000000004000000120</ID>
      </Grantee>
      <Permission>FULL_CONTROL</Permission>
    </Grant>
  </AccessControlList>
</AccessControlPolicy>

Response sample
HTTP/1.1 200 OK
Date: Thu, 16 Jun 2011 15:46:10 GMT