Scalr\Service\Aws\S3\Handler\BucketHandler::getPolicy PHP Method

getPolicy() public method

This implementation of the GET operation uses the policy subresource to return the policy of a specified bucket. To use this operation, you must have GetPolicy permissions on the specified bucket, and you must be the bucket owner.
public getPolicy ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
return string Returns bucket policy string (json encoded)
    public function getPolicy($bucketName)
    {
        if ($bucketName instanceof BucketData) {
            $bucketName = $bucketName->bucketName;
        }
        return $this->getS3()->getApiHandler()->getBucketPolicy($bucketName);
    }