setIamPolicy method
Sets the IAM policy that is attached to a google.iam.admin.v1.ServiceAccount.
Use this method to grant or revoke access to the service account. For example, you could grant a principal the ability to impersonate the service account.
This method does not enable the service account to access other resources. To grant roles to a service account on a resource, follow these steps:
- Call the resource's
getIamPolicymethod to get its current IAM policy. - Edit the policy so that it binds the service account to an IAM role for the resource.
- Call the resource's
setIamPolicymethod to update its IAM policy.
For detailed instructions, see Manage access to project, folders, and organizations or Manage access to other resources.
Implementation
$grpc.ResponseFuture<$3.Policy> setIamPolicy(
$2.SetIamPolicyRequest request, {
$grpc.CallOptions? options,
}) {
return $createUnaryCall(_$setIamPolicy, request, options: options);
}