getAdapter(); $client = $adapter-" /> getAdapter(); $client = $adapter-" /> getAdapter(); $client = $adapter-"/>

AWS-SDK: Error executing GetObjectAcl got an AccessDenied

211 Views Asked by At

My main goal is to get the ACL info on a specific object.

$fileSystem = Storage::disk("s3");
$adapter = $fileSystem->getAdapter();
$client = $adapter->getClient();
$objectInfo = $client->getObjectAcl(
  [
    'Bucket' => 'bucket-name',
    'Key'    => "key-name",
  ]
);

When running, I get the error :

Aws/S3/Exception/S3Exception with message 'Error executing "GetObjectAcl" ...
resulted in a `403 Forbidden` response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Error> 
<Code>AccessDenied</Code>
    <Message>Access Denied</Message>
    < (truncated...)AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
   <Error><Code>AccessDenied</Code>
   <Message>Access Denied</Message> 
 <Resource>

Any idea to resolve it would be thankful.

0

There are 0 best solutions below