Obtains the ACL for a bucket. Only the owner of a bucket can obtain the ACL for the bucket.

Request syntax

GET /? acl HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Response elements

Elements Type Description
Accesscontrollist Container Specifies the container used to store the ACL information.

Parent node: AccessControlPolicy

AccessControlPolicy Container Specifies the container that stores the result to the GetBucketACL request.

Parent node: None

Displayname String Indicates the name of the bucket owner, which is the same as the value of ID. 

Parent Node: AccessControlPolicy.Owner

Grant Enumerated string  Indicates the ACL for the bucket.

Valid values: private, public-read, and public-read-write

Parent node: AccessControlPolicy.AccessControlList

ID String Indicates the user ID of the bucket owner.

Parent node: AccessControlPolicy.Owner

Owner Container Indicates the container used to store the information about the bucket owner.

Parent node: AccessControlPolicy

Examples

Request example:

GET /? acl HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 24 Feb 2012 04:11:23 GMT
Authorization: OSS qn6qrrqxo2oawuk53otfjbyc:CTkuxpLAi4XZ+WwIfNm0FmgbrQ0=

Response example:

HTTP/1.1 200 OK
x-oss-request-id: 534B371674E88A4D8906008B
Date: Fri, 24 Feb 2012 04:11:23 GMT 
Content-Length: 253
Content-Type: application/xml
Connection: keep-alive
Server: AliyunOSS

<? xml version="1.0" ? >
<AccessControlPolicy>
    <Owner>
        <ID>00220120222</ID>
        <DisplayName>user_example</DisplayName>
    </Owner>
    <AccessControlList>
        <Grant>public-read</Grant>
    </AccessControlList>
</AccessControlPolicy>

SDK

The SDKs of this API are as follows:

Error codes

Error code HTTP status code Description
NoSuchBucket 404 The target bucket does not exist.
AccessDenied 403 You do not have the permission to perform this operation. Only the owner of a bucket can obtain the ACL for the bucket.