x-cos-acl
和 x-cos-grant-*
传入 ACL 信息,或者通过请求体以 XML 格式传入 ACL 信息。PUT /?acl HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-Length: 0Authorization: Auth String
PUT /?acl HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-Type: application/xmlContent-Length: Content LengthContent-MD5: MD5Authorization: Auth String[Request Body]
名称 | 描述 | 类型 | 是否必选 |
x-cos-acl | Enum | 否 | |
x-cos-grant-read | 赋予被授权者读取存储桶的权限。若被授权者为主账号,格式为 id="[OwnerUin]",如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/GrantsUin]",如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-write | 赋予被授权者写入存储桶的权限。若被授权者为主账号,格式为 id="[OwnerUin]",如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/GrantsUin]",如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-read-acp | 赋予被授权者读取存储桶的访问控制列表(ACL)的权限。若被授权者为主账号,格式为 id="[OwnerUin]",如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/GrantsUin]",如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-write-acp | 赋予被授权者写入存储桶的访问控制列表(ACL)的权限。若被授权者为主账号,格式为 id="[OwnerUin]",如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/GrantsUin]",如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,如 id="100000000001",id="100000000002" | string | 否 |
x-cos-grant-full-control | 赋予被授权者操作存储桶的所有权限。若被授权者为主账号,格式为 id="[OwnerUin]",如 id="100000000001";若被授权者为子账号,格式为 id="[OwnerUin/GrantsUin]",如 id="100000000001/100000000011"。可使用半角逗号(,)分隔多组被授权者,如 id="100000000001",id="100000000002" | string | 否 |
<AccessControlPolicy><Owner><ID>string</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>string</URI></Grantee><Permission>Enum</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>string</ID></Grantee><Permission>Enum</Permission></Grant></AccessControlList></AccessControlPolicy>
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
AccessControlPolicy | 无 | 包含 PUT Bucket acl 操作的所有请求信息 | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Owner | AccessControlPolicy | 存储桶持有者信息 | Container | 是 |
AccessControlList | AccessControlPolicy | 被授权者信息与权限信息 | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
ID | AccessControlPolicy.Owner | 存储桶持有者的完整 ID,格式为 qcs::cam::uin/[OwnerUin]:uin/[OwnerUin] ,如 qcs::cam::uin/100000000001:uin/100000000001 | string | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Grant | AccessControlPolicy.AccessControlList | 单个授权信息,一个 AccessControlList 最多只能拥有100条 Grant | Container | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
Grantee | AccessControlPolicy.AccessControlList.Grant | 被授权者信息, xsi:type 可指定为 Group 或 CanonicalUser,当指定为 Group 时子节点包括且仅允许包括 URI,当指定为 CanonicalUser 时子节点包括且仅允许包括 ID | Container | 是 |
Permission | AccessControlPolicy.AccessControlList.Grant | Enum | 是 |
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 |
URI | AccessControlPolicy.AccessControlList.Grant.Grantee | 预设用户组。请参见 ACL 概述 文档中预设用户组部分,如 http://cam.qcloud.com/groups/global/AllUsers 或 http://cam.qcloud.com/groups/global/AuthenticatedUsers | string | 当 Grantee 的 xsi:type 指定为 Group 时必选 |
ID | AccessControlPolicy.AccessControlList.Grant.Grantee | 被授权者的完整 ID,格式为 qcs::cam::uin/[OwnerUin]:uin/[OwnerUin] ,如 qcs::cam::uin/100000000001:uin/100000000001 | string | 当 Grantee 的 xsi:type 指定为 CanonicalUser 时必选 |
PUT /?acl HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Mon, 17 Jun 2019 08:30:12 GMTx-cos-acl: public-readx-cos-grant-write: id="100000000002"x-cos-grant-read-acp: id="100000000002"Content-Length: 0Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1560760212;1560767412&q-key-time=1560760212;1560767412&q-header-list=content-length;date;host;x-cos-acl;x-cos-grant-read-acp;x-cos-grant-write&q-url-param-list=acl&q-signature=5b10c6ea4e6c9630c085e1f85476c76d8c4e****Connection: close
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Mon, 17 Jun 2019 08:30:13 GMTServer: tencent-cosx-cos-request-id: NWQwNzRmOTRfODhjMjJhMDlfMWRlYl81Mzc0****
PUT /?acl HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Mon, 17 Jun 2019 08:30:13 GMTContent-Type: application/xmlContent-Length: 812Content-MD5: 1qS+8SqnivarcO6Z11R0nw==Authorization: q-sign-algorithm=sha1&q-ak=AKID8A0fBVtYFrNm02oY1g1JQQF0c3JO****&q-sign-time=1560760213;1560767413&q-key-time=1560760213;1560767413&q-header-list=content-length;content-md5;content-type;date;host&q-url-param-list=acl&q-signature=70f96b91823f3715905df125d96fe447554e****Connection: close<AccessControlPolicy><Owner><ID>qcs::cam::uin/100000000001:uin/100000000001</ID></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://cam.qcloud.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>qcs::cam::uin/100000000002:uin/100000000002</ID></Grantee><Permission>WRITE</Permission></Grant><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>qcs::cam::uin/100000000002:uin/100000000002</ID></Grantee><Permission>READ_ACP</Permission></Grant></AccessControlList></AccessControlPolicy>
HTTP/1.1 200 OKContent-Length: 0Connection: closeDate: Mon, 17 Jun 2019 08:30:13 GMTServer: tencent-cosx-cos-request-id: NWQwNzRmOTVfMzBjMDJhMDlfOTM3MF8yNzdj****
本页内容是否解决了您的问题?