获取对象 ACL
功能说明
获取指定文件的 ACL 信息。
方法原型
func (s *ObjectService) GetACL(ctx context.Context, key string) (*ObjectGetACLResult, *Response, error)
请求示例
key := "test/hello.txt"
v, resp, err := client.Object.GetACL(context.Background(), key)
参数说明
参数名称 | 参数描述 | 类型 | 必填 |
---|
key | 对象键(Key)是对象在存储桶中的唯一标识。例如,在对象的访问域名 bucket1-1250000000.cos.ap-guangzhou.myqcloud.com/doc1/pic1.jpg 中,对象键为 doc1/pic1.jpg | string | 是 |
返回结果说明
type ACLXml struct {
Owner *Owner
AccessControlList []ACLGrant
}
type Owner struct {
ID string
DisplayName string
}
type ACLGrant struct {
Grantee *ACLGrantee
Permission string
}
type ACLGrantee struct {
Type string
ID string
DisplayName string
UIN string
}
参数名称 | 参数描述 | 类型 |
---|
Owner | Bucket 拥有者的信息,包括 DisplayName 和 ID | struct |
AccessControlList | Bucket 权限授予者的信息,包括 Grantee和 Permission | struct |
Grantee | 权限授予者的信息,包括 DisplayName,Type,ID 和 UIN | struct |
Type | 权限授予者的类型,类型为 CanonicalUser 或者 Group | string |
ID | Type 为 CanonicalUser 时,对应权限授予者的 ID | string |
DisplayName | 权限授予者的名字 | string |
UIN | Type 为 Group 时,对应权限授予者的 UIN | string |
Permission | 授予者所拥有的 Bucket 的权限,可选值有 FULL_CONTROL,WRITE,READ,分别对应读写权限、写权限、读权限 | string |