PHP 클래스 Google\Cloud\Iam\Iam

This class is not meant to be used directly. It should be accessed through other objects which support IAM. Note that examples make use of the PubSub API, and the {@see \Google\Cloud\PubSub\Topic} class. Policies can be created using the {@see \Google\Cloud\Iam\PolicyBuilder} to help ensure their validity. Example: IAM policies are obtained via resources which implement IAM. In this example, we'll use PubSub topics to demonstrate how IAM politices are managed. use Google\Cloud\ServiceBuilder; $cloud = new ServiceBuilder; $pubsub = $cloud->pubsub(); $topic = $pubsub->topic('my-new-topic'); $iam = $topic->iam();
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$connection Google\Cloud\Iam\IamConnectionInterface

공개 메소드들

메소드 설명
__construct ( Google\Cloud\Iam\IamConnectionInterface $connection, string $resource )
policy ( array $options = [] ) : array Get the existing IAM policy for this resource.
reload ( array $options = [] ) : array Refresh the IAM policy for this resource.
setPolicy ( array $policy, array $options = [] ) : array Set the IAM policy for this resource.
testPermissions ( array $permissions, array $options = [] ) : array Test if the current user has the given permissions on this resource.

메소드 상세

__construct() 공개 메소드

public __construct ( Google\Cloud\Iam\IamConnectionInterface $connection, string $resource )
$connection Google\Cloud\Iam\IamConnectionInterface
$resource string

policy() 공개 메소드

If a policy has already been retrieved from the API, it will be returned. To fetch a fresh copy of the policy, use {@see \Google\Cloud\Iam\Iam::reload()}. Example: $policy = $iam->policy();
public policy ( array $options = [] ) : array
$options array Configuration Options
리턴 array An array of policy data

reload() 공개 메소드

Example: $policy = $iam->reload();
public reload ( array $options = [] ) : array
$options array Configuration Options
리턴 array An array of policy data

setPolicy() 공개 메소드

Bindings with invalid roles, or non-existent members will raise a server error. Example: $oldPolicy = $iam->policy(); $oldPolicy['bindings'][0]['members'] = 'user:[email protected]'; $policy = $iam->setPolicy($oldPolicy);
public setPolicy ( array $policy, array $options = [] ) : array
$policy array A new policy array
$options array Configuration Options
리턴 array An array of policy data

testPermissions() 공개 메소드

Invalid permissions will raise a BadRequestException. A list of allowed permissions can be found in the access control documentation. Example: $allowedPermissions = $iam->testPermissions([ 'pubsub.topics.publish', 'pubsub.topics.attachSubscription' ]);
public testPermissions ( array $permissions, array $options = [] ) : array
$permissions array A list of permissions to test
$options array Configuration Options
리턴 array A subset of $permissions, with only those allowed included.

프로퍼티 상세

$connection 보호되어 있는 프로퍼티

protected IamConnectionInterface,Google\Cloud\Iam $connection
리턴 Google\Cloud\Iam\IamConnectionInterface