帮助与文档

我们为你提供丰富、详尽的使用指南以及产品文档

PUT Bucket ACL

设置存储空间的访问控制列表 (Access Control List),acl 是存储空间的子资源 (subresource),只有存储空间的所有者才能设置。

获取 ACL 请参见 GET Bucket ACL

Request Syntax

PUT /?acl HTTP/1.1
Host: <bucket-name>.<zone-id>.qingstor.com
Date: <date>
Authorization: <authorization-string>

{
  "acl": [
    {
      "grantee": {
        "type": "user",
        "id":
      },
      "permission": "FULL_CONTROL"
    },
    {
      "grantee": {
        "type": "group",
        "name": <group-name>
      },
      "permission": "READ"
    }
  ]
}

Request Parameters

没有请求参数

Request Headers

参见公共请求头

Request Elements

Name Type Description
acl List 支持设置 0 到多个被授权者
grantee Dict 支持 user, group 两种类型,当设置 user 类型时,需要给出 user id;当设置 group 类型时,目前只支持 QS_ALL_USERS,代表所有用户
permission String 支持三种权限为 READ, WRITE, FULL_CONTROL

Response Headers

参见公共响应头

Example

Example Request

PUT /?acl HTTP/1.1
Host: mybucket.pek3a.qingstor.com
Date: Sun, 16 Aug 2015 09:05:00 GMT
Content-Length: 157
Authorization: authorization string

{
  "acl": [
    {
      "grantee": {
        "type": "user",
        "id": "usr-1mvNCzZu"
      },
      "permission": "FULL_CONTROL"
    },
    {
      "grantee": {
        "type": "group",
        "name": "QS_ALL_USERS"
      },
      "permission": "READ"
    }
  ]
}

Example Response

HTTP/1.1 200 OK
Server: QingStor
Date: Sun, 16 Aug 2015 09:05:00 GMT
Content-Length: 0
Connection: close
x-qs-request-id: aa08cf7a43f611e5886952542e6ce14b