删除后拒绝AWS S3访问

问题描述:

我有一个可以毫无问题地写入的存储桶.但是,当我尝试删除对象时,出现错误...

I have a bucket that I can write to with no problem. However, when I try to delete an object, I get an error ...

AccessDeniedException in NamespaceExceptionFactory.php line 91

在最基本的示例之后在这里,我来了用这个命令...

Following the very basic example here, I came up with this command ...

$result = $s3->deleteObject(array(
                'Bucket' => $bucket,
                'Key'    => $keyname
            ));  

我已经根据其他教程和发现的问题尝试了这种变化.

I have tried variations of this based upon other tutorials and questions I have found.

$result = $s3->deleteObject(array(
                'Bucket' => $bucket,
                'Key'    => $keyname,
                'Content-Type'  => $contentType,
                'Content-Length' => 0
            ));  

但是一切都会产生相同的错误.有什么建议吗?

But everything produces the same error. Any suggestions?

用户可能能够在存储桶中创建对象,但不一定意味着同一用户可以删除他/她可能已经创建的对象.

User may be able to create an object in a bucket doesn't necessarily imply that the same user can deleted the object that he/she may have created.

S3权限可以在资源级别(存储桶/前缀)进行细化,您的角色可以执行的操作可以是一个或多个权限(请参阅:

S3 permission can be granular at the resource level (bucket/prefix) where the action that your role can take could be one or many of the permissions (see: http://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html)

您似乎拥有s3:PutObject权限,但没有s3:DeleteObject.

It looks like you are having s3:PutObject permission but not s3:DeleteObject.