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

Can we use aws s3api put-object-acl --acl to change the permission to write?

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"
        }
    ]
}

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

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

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