Cloud Storage Client - Class Acl (1.35.0)

Reference documentation and code samples for the Cloud Storage Client class Acl.

Google Cloud Storage uses access control lists (ACLs) to manage bucket and object access. ACLs are the mechanism you use to share objects with other users and allow other users to access your buckets and objects. For more information please see the overview on access-control.

Example:

use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient();

$bucket = $storage->bucket('my-bucket');
$acl = $bucket->acl();

Namespace

Google \ Cloud \ Storage

Methods

__construct

Parameters
NameDescription
connection Google\Cloud\Storage\Connection\ConnectionInterface

Represents a connection to Cloud Storage. This object is created by StorageClient, and should not be instantiated outside of this client.

type string

The type of access control this instance applies to.

identity array

Represents which bucket, file, or generation this instance applies to.

delete

Parameters
NameDescription
entity string

The entity to delete.

options array

[optional] Configuration Options.

Returns
TypeDescription
void

get

Parameters
NameDescription
options array

Configuration options.

↳ entity string

The entity to fetch.

Returns
TypeDescription
array

add

Parameters
NameDescription
entity string

The entity to add access controls to.

role string

The permissions to add for the specified entity. May be one of 'OWNER', 'READER', or 'WRITER'.

options array

[optional] Configuration Options.

Returns
TypeDescription
array

update

Parameters
NameDescription
entity string

The entity to update access controls for.

role string

The permissions to update for the specified entity. May be one of 'OWNER', 'READER', or 'WRITER'.

options array

[optional] Configuration Options.

Returns
TypeDescription
array

Constants

ROLE_READER

Value: 'READER'

ROLE_WRITER

Value: 'WRITER'

ROLE_OWNER

Value: 'OWNER'