Google\Cloud\Storage\Acl::get PHP Method

get() public method

Example: $res = $acl->get(['entity' => 'allAuthenticatedUsers']);
See also: https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/get BucketAccessControls get API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/defaultObjectAccessControls/get DefaultObjectAccessControls get API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/get ObjectAccessControls get API documentation.
public get ( array $options = [] ) : array
$options array [optional] { Configuration options. @type string $entity The entity to fetch. }
return array
    public function get(array $options = [])
    {
        if (isset($options['entity'])) {
            return $this->connection->getAcl($options + $this->aclOptions);
        }
        $response = $this->connection->listAcl($options + $this->aclOptions);
        return $response['items'];
    }

Usage Example

 public function testGetWithSpecifiedEntity()
 {
     $accessControl = ['entity' => 'allAuthenticatedUsers'];
     $this->connection->getAcl(Argument::any())->willReturn($accessControl);
     $acl = new Acl($this->connection->reveal(), 'bucketAccessControls', ['bucket' => 'bucket']);
     $this->assertEquals($accessControl, $acl->get(['entity' => 'allAuthenticatedUsers']));
 }