PUT Object ACL
The PUT Object ACL sets the access control list (ACL) permissions on an existing bucket object. To set ACL permissions on an existing bucket object, you must have WRITE_ACP
permissions. You can choose to use request headers to specify the permissions, or specify the ACL in the request body.
Versioning
The ACL for an object is set at the object version level. By default, a PUT
request sets the ACL for the current version of the object. To set the ACL for a
different version, use the versionId
subresource.
Request Parameters
This implementation of the PUT Object ACL operation does not support the use of request parameters.
Request Headers
The PUT Object ACL operation supports the use of the following access-control headers to set permissions:
-
x-amz-acl
header. Use this header to specify canned ACL permissions. -
x-amz-grant-permission
header. Use this header to individually specify the permissions for a grantee.
For more information about how to specify ACL permissions, see:
Request Elements
The PUT Object ACL operation supports the use of request elements when not using a request body. Note that if you use a request body, you cannot use the request headers to set an ACL. For a list of supported request elements, see PUT Object acl.
Response Headers
The PUT Object ACL operation supports the use of the following response headers:
-
Response headers common to all operations. For more information, see table "Supported Response Headers" in Supported Common Response Headers.
-
Response headers for a PUT Object operation, which include
x-amz-version-id
. For further details about this response header, see PUT Object acl.
Response Elements
This implementation of the PUT Object ACL does not support the use of response elements.
Error Response Codes
The PUT Object ACL operation does not return special errors. For general information about S3 errors and a list of error codes, see S3 Client Error Handling Reference.
Example
PUT /my-image.jpg?acl <AccessControlPolicy> <Owner> <ID>joe</ID> <DisplayName>joe/DisplayName> </Owner> <AccessControlList> <Grant> <Grantee type="CanonicalUser"> <ID>jack</ID> <DisplayName>joe</DisplayName> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> </AccessControlList> </AccessControlPolicy> HTTP/1.1 200 OK x-amz-request-id: tx318BC8BC148832E5 x-amz-version-id: 0055 Date: Wed, 28 Oct 2018 22:32:00 GMT Last-Modified: Sun, 1 Jan 2018 12:00:00 GMT Content-Length: 0 Connection: close Server: Apache
Alternatively, a request can also be made to a specific version of an object, for instance:
PUT /my-image.jpg?acl&versionId=0099