Manage object ACLs (OSS SDK for Go 1.0)
This topic describes how to manage the access control lists (ACLs) of objects in a versioned bucket.
Notes
-
In this topic, the public endpoint of the China (Hangzhou) region is used. If you want to access OSS from other Alibaba Cloud services in the same region as OSS, use an internal endpoint. For more information about OSS regions and endpoints, see Regions and Endpoints.
-
In this topic, access credentials are obtained from environment variables. For more information about how to configure access credentials, see Configure access credentials.
-
This topic demonstrates creating an OSSClient instance with an OSS endpoint. For alternative configurations, such as using a custom domain or authenticating with credentials from Security Token Service (STS), see Configure a client (Go SDK V1).
-
To set the ACL for an object, you must have the
oss:PutObjectAclpermission. To retrieve the ACL of an object, you must have theoss:GetObjectAclpermission. For more information, see Grant a custom policy.
Sample Code
References
-
For more information about the API operation that you can call to configure the ACL of an object, see SetObjectACL.
-
For more information about the API operation that you can call to query the ACL of an object, see GetObjectACL.