PHP Class Google\Cloud\Storage\Acl

Example: use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder(); $storage = $cloud->storage(); $bucket = $storage->bucket('my-bucket'); $acl = $bucket->acl();
显示文件 Open project: GoogleCloudPlatform/gcloud-php Class Usage Examples

Protected Properties

Property Type Description
$connection Represents a connection to Cloud Storage.

Public Methods

Method Description
__construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $type, array $identity )
add ( string $entity, string $role, array $options = [] ) : array Add access controls on a {@see Google\Cloud\Storage\Bucket} or {@see Google\Cloud\Storage\StorageObject}.
delete ( string $entity, array $options = [] ) : void Delete access controls on a {@see Google\Cloud\Storage\Bucket} or {@see Google\Cloud\Storage\StorageObject} for a specified entity.
get ( array $options = [] ) : array Get access controls on a {@see Google\Cloud\Storage\Bucket} or {@see Google\Cloud\Storage\StorageObject}. By default this will return all available access controls. You may optionally specify a single entity to return details for as well.
update ( string $entity, string $role, array $options = [] ) : array Update access controls on a {@see Google\Cloud\Storage\Bucket} or {@see Google\Cloud\Storage\StorageObject}.

Method Details

__construct() public method

public __construct ( Google\Cloud\Storage\Connection\ConnectionInterface $connection, string $type, array $identity )
$connection Google\Cloud\Storage\Connection\ConnectionInterface Represents a connection to Cloud Storage.
$type string The type of access control this instance applies to.
$identity array Represents which bucket, file, or generation this instance applies to.

add() public method

Example: $acl->add('allAuthenticatedUsers', 'WRITER');
See also: https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/insert BucketAccessControls insert API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/defaultObjectAccessControls/insert DefaultObjectAccessControls insert API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert ObjectAccessControls insert API documentation.
public add ( string $entity, string $role, array $options = [] ) : array
$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.
return array

delete() public method

Example: $acl->delete('allAuthenticatedUsers');
See also: https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/delete BucketAccessControls delete API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/defaultObjectAccessControls/delete DefaultObjectAccessControls delete API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/delete ObjectAccessControls delete API documentation.
public delete ( string $entity, array $options = [] ) : void
$entity string The entity to delete.
$options array [optional] Configuration Options.
return void

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

update() public method

Example: $acl->update('allAuthenticatedUsers', 'READER');
See also: https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls/patch BucketAccessControls patch API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/defaultObjectAccessControls/patch DefaultObjectAccessControls patch API documentation.
See also: https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/patch ObjectAccessControls patch API documentation.
public update ( string $entity, string $role, array $options = [] ) : array
$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.
return array

Property Details

$connection protected_oe property

Represents a connection to Cloud Storage.
protected $connection