PutObjectAcl¶
Uses the acl subresource to set the access control list (ACL) permissions for an existing object in an S3 bucket.
Depending on your application needs, you can choose to set the ACL on an object using either the request body or the headers. For more information, see Access Control List (ACL) Overview.
Access Permissions
You can set access permissions using one of the following methods:
Specify a canned ACL with the
x-amz-acl
request header. Tebi supports a set of predefined ACLs known as canned ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL name as the value ofx-amz-acl
. If you use this header, you cannot use other access control-specific headers in your request. Valid Values:private
|public-read
|public-read-write
.Grant a
Read
permission to thehttp://acs.amazonaws.com/groups/global/AllUsers
group in the request body XML.
You must have ACL
ACL to be able to call this action.
The following operations are related to PutObjectAcl
:
Request Syntax¶
1PUT /<KEY>?acl HTTP/1.1
2Host: <BUCKET>.s3.tebi.io
3x-amz-acl: ACL
4
5<AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
6 <AccessControlList>
7 <Grant>
8 <Grantee>
9 <DisplayName>string</DisplayName>
10 <EmailAddress>string</EmailAddress>
11 <ID>string</ID>
12 <xsi:type>string</xsi:type>
13 <URI>string</URI>
14 </Grantee>
15 <Permission>string</Permission>
16 </Grant>
17 </AccessControlList>
18 <Owner>
19 <DisplayName>string</DisplayName>
20 <ID>string</ID>
21 </Owner>
22</AccessControlPolicy>
The request uses the following URI parameters:
<BUCKET>: Bucket name that contains the object to which you want to attach the ACL. Required.
<KEY>: Key for which the PUT action was initiated.
x-amz-acl: Canned ACL to apply to the object. Valid Values:
private
|public-read
|public-read-write
.
The request accepts the following data in XML format:
AccessControlPolicy: Root level tag for the AccessControlPolicy parameters.
Grants: List of grants.
Owner: Container for the bucket owner’s display name and ID.
Response Syntax¶
1HTTP/1.1 200
2Content-Length: 0
If the action is successful, the service sends back an HTTP 200 response.
See Also¶
Refer here for more information.