我们可以使用aws s3api put-object-acl --acl来更改写入权限吗?

时间:2016-12-07 09:13:57

标签: ibm-cloud-infrastructure object-storage ibm-cloud-storage

aws --endpoint-url=https://s3-api.us-geo.objectstorage.softlayer.net s3api put-object-acl --bucket mytestbucket --key foo.txt --acl public-read-write

aws --endpoint-url=https://s3-api.us-geo.objectstorage.softlayer.net s3api get-object-acl --bucket mytestbucket --key foo.txt

{
    "Owner": {
        "DisplayName": "b25ce81dcaa1498db3d1c802b3fdd",
        "ID": "b25ce81dcaa1498db3d1c802b3fdd"
    },
    "Grants": [
        {
            "Grantee": {
                "Type": "Group",
                "URI": "ttp://acs.amazonaws.com/groups/global/AllUsers"
            },
            "Permission": "READ"
        },
        {
            "Grantee": {
                "Type": "CanonicalUser",
                "DisplayName": "b25ce81dcaa1498db3d1c802b3fdd",
                "ID": "b25ce81dcaa1498db3d1c802b3fdd"
            },
            "Permission": "FULL_CONTROL"
        }
    ]
}

1 个答案:

答案 0 :(得分:0)

使用ACL授予特定帐户WRITE权限只能在存储桶级别进行。仍然可以使用预设ACL为对象授予PUBLIC-READ-WRITE权限,但只会设置READ个权限。

对象ACL仅限于授予特定帐户READREAD_ACP(读取ACL)或WRITE_ACP(写入ACL)权限,FULL_CONTROL授予所有三种权限。也就是说,您发布的CLI命令是正确的,AWS对对象ACL也有相同的限制。

有关创建对象ACL的更多信息,请see the API documentation