All Products
Search
Document Center

Object Storage Service:GetBucketAcl

Last Updated:Apr 28, 2024

You can call this operation to query the ACL of a bucket. Only the bucket owner can query the ACL of the bucket.

Request syntax

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

Response elements

Element

Type

Description

AccessControlList

Container

The container that contains the ACL information.

Parent node: AccessControlPolicy.

AccessControlPolicy

Container

The container that contains the result of the GetBucketACL request.

Parent node: none.

DisplayName

String

The name of the bucket owner, which is currently the same as the user ID.

Parent node: AccessControlPolicy and Owner.

Grant

Enumeration

The ACL for the bucket.

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

Parent node: AccessControlPolicy and AccessControlList.

ID

String

The user ID of the bucket owner.

Parent node: AccessControlPolicy and Owner.

Owner

Container

The container that contains the information about the bucket owner.

Parent node: AccessControlPolicy.

Examples

Sample requests

GET /? acl HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 24 Feb 2012 04:11:23 GMT
Authorization: OSS qn6qn6q**************:77Dv****************	

Sample success responses

HTTP/1.1 200 OK
x-oss-request-id: 534B371674E88A4D8906****
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>0022012****</ID>
        <DisplayName>user_example</DisplayName>
    </Owner>
    <AccessControlList>
        <Grant>public-read</Grant>
    </AccessControlList>
</AccessControlPolicy>

SDKs

The SDKs of the GetBucketAcl operation for various programming languages are as follows:

Error codes

Error code

HTTP status code

Description

NoSuchBucket

404

The error message returned because the specified bucket does not exist.

AccessDenied

403

The error message returned because you are not authorized to query the ACL of the bucket. Only the bucket owner can query the ACL of the bucket.