Access Control List (ACL) is a resource-based access policy option that manages access to buckets and objects. You can grant read and write permissions to other root accounts, sub-accounts and user groups using ACLs.
Unlike an access policy, an ACL in Tencent Cloud has the following limits on the permissions:
Control granularities supported by ACLs
When a bucket or object is created, the root account to which the bucket or object's resources belong has full access to these resources, and the access cannot be modified or deleted. You can use ACLs to grant other Tencent Cloud accounts the access permissions.
The following is an ACL example for a bucket. 100000000001 is the root account, 100000000011 is its sub-account, and 100000000002 is another root account. The ACL contains an Owner element that identifies the bucket owner, who has full access to the bucket. The Grant element grants anonymous read permission, which is expressed as READ permission of
<AccessControlPolicy> <Owner> <ID>qcs::cam::uin/100000000001:uin/100000000001</ID> <DisplayName>qcs::cam::uin/100000000001:uin/100000000001</DisplayName> </Owner> <AccessControlList> <Grant> <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RootAccount"> <ID>qcs::cam::uin/100000000001:uin/100000000001</ID> <DisplayName>qcs::cam::uin/100000000001:uin/100000000001</DisplayName> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> <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> </AccessControlList> </AccessControlPolicy>
You can grant access permissions to other root accounts using the definition of the principal in CAM, as described below:
You can grant access permissions to sub-accounts (such as 100000000011) under your root account or those under other root accounts using the definition of the principal in CAM, as described below:
You can grant access permissions to anonymous users using the definition of the principal in CAM, as described below:
The operation sets supported by ACLs are listed below.
|Operation Set||Access to Bucket||Access to Prefix||Access to Object|
|READ||Lists and reads objects in the bucket||Lists and reads objects in the directory||Reads objects|
|WRITE||Creates, overwrites and deletes any object in the bucket||Creates, overwrites and deletes any object in the directory||Not supported|
|READ_ACP||Reads the ACL of bucket||Reads the ACL in the directory||Reads the ACL of object|
|WRITE_ACP||Modifies the ACL of bucket||Modifies the ACL in the directory||Modifies the ACL of object|
|FULL_CONTROL||Any operations on the bucket and objects||Any operations on the objects in the directory||Any operations on the objects|
COS supports a range of predefined authorizations, which are called standard ACLs. The meanings of the standard ACLs are listed below.
A root account always has the FULL_CONTROL permission, which is not described here.
|(Null)||This is the default policy. Others do not have permissions. The permissions for resources are inherited from upper level.|
|private||Other users do not have permissions|
|public-read||Anonymous user group has the READ permission|
|public-read-write||Anonymous user group has the READ and WRITE permissions. This is not recommended for buckets.|
Set an ACL for a bucket
The following example grants another root account the read access to a bucket:
Set an ACL for an object
The following example grants another root account the read access to an object:
If the message You have no access to it appears when you access a bucket or object using a sub-account, grant the sub-account the access to the bucket through the root account. For more information, see Accessing Bucket List Using Sub-Account.
|PUT Bucket acl||Setting bucket ACL||Sets the ACL for a specified bucket|
|GET Bucket acl||Querying bucket ACL||Queries the ACL of a bucket|
|PUT Object acl||Setting object ACL||Sets the ACL for a specified object in a bucket|
|GET Object acl||Querying object ACL||Queries the ACL of an object|