最近更新时间:2023.11.21 10:22:21
首次发布时间:2021.10.13 16:14:08
此接口用于设置对象的访问控制权限。用户可以在上传对象的时候设置对象的 ACL,也可以上传对象后通过此接口修改 ACL。默认设置当前版本的 ACL,可以通过versionId
来设置指定版本对象的 ACL。
PUT /ObjectName?acl HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Date: GMT Date Authorization: authorization string { "Owner": { "ID": "test-cid" }, "Grants": [{ "Grantee": { "Type": "CanonicalUser", "ID": "test-cid" }, "Permission": "FULL_CONTROL" }] }
该请求使用的公共消息头,请参见公共参数。
名称 | 位置 | 参数类型 | 是否必选 | 示例值 | 说明 |
---|---|---|---|---|---|
acl | Query | String | 是 | 代表 PutObjectACL 请求的特殊标识。 | |
x-tos-acl | Header | String | 否 | private | 对象的访问权限,有效的权限设置包括:
|
versionId | Query | String | 否 | 57AF1A32CECB56721267 | 对象的版本号。标识更改指定版本的对象 ACL。 |
名称 | 参数类型 | 说明 |
---|---|---|
Grants | Array | 对象的访问控制权限根节点。 |
Grantee | Object | 被授权用户信息。父节点为 Grants。 |
Type | String | 用户类型。父节点为 Grantee。 |
Canned | String | 当 Type 为 Group 时,使用该字段。取值说明如下:
父节点为 Grantee。 |
ID | String | 当 Type 为 CanonicalUser 时,使用该字段,代表被授权的用户 ID。父节点为 Grantee。 |
Permission | String | 授权类型。父节点为 Grants。 |
Owner | Object | 对象所有者。 |
ID | String | 账号 ID。父节点为 Owner。 |
该请求返回公共响应消息头。
该请求响应中无消息元素。
PUT /ObjectName?acl HTTP/1.1 Host: bucketname.tos-cn-beijing.volces.com Date: Fri, 30 Jul 2021 13:59:18 GMT Authorization: authorization string { "Owner": { "ID": "AccountID" }, "Grants": [ { "Grantee": { "ID": "test-cid", "Type": "CanonicalUser" }, "Permission": "FULL_CONTROL" } ] }
HTTP/1.1 200 OK x-tos-id-2: 4fac130beeb50032-a444ed0 x-tos-request-id: 4fac130beeb50032-a444ed0 Date: Fri, 30 Jul 2021 13:59:18 GMT server: TosServer Content-Length: 0