Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
A Policy consists of a list of bindings. A binding binds a list of members to a role, where the members can be user accounts, Google groups, Google domains, and service accounts. A role is a named list of permissions defined by IAM.
etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to getIamPolicy, and systems are expected to put that etag in the request to setIamPolicy to ensure that their change will be applied to the same version of the policy.
If no etag is provided in the call to setIamPolicy, then the existing policy is overwritten blindly.
Unimplemented. The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Expr
Represents an expression text. Example:
title: "User account presence"
description: "Determines whether the request has a user account"
expression: "size(request.user) > 0"
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-30 UTC."],[[["\u003cp\u003eThis content defines an Identity and Access Management (IAM) policy used for specifying access control to Cloud Platform resources.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003ePolicy\u003c/code\u003e is composed of \u003ccode\u003ebindings\u003c/code\u003e, which link \u003ccode\u003emembers\u003c/code\u003e (like users or groups) to a defined \u003ccode\u003erole\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eBinding\u003c/code\u003e defines a \u003ccode\u003erole\u003c/code\u003e and the list of associated \u003ccode\u003emembers\u003c/code\u003e, and may include a conditional \u003ccode\u003eExpr\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eetag\u003c/code\u003e field in the JSON representation of a policy is crucial for preventing concurrent policy updates from overwriting each other.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eExpr\u003c/code\u003e object is used to define a custom condition that, when attached to a \u003ccode\u003eBinding\u003c/code\u003e will add conditions to the roles, and can consist of a title, description, and expression.\u003c/p\u003e\n"]]],[],null,["# Policy\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Binding](#Binding)\n - [JSON representation](#Binding.SCHEMA_REPRESENTATION)\n- [Expr](#Expr)\n - [JSON representation](#Expr.SCHEMA_REPRESENTATION)\n\nDefines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.\n\nA `Policy` consists of a list of `bindings`. A `binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.\n\n**JSON Example** \n\n {\n \"bindings\": [\n {\n \"role\": \"roles/owner\",\n \"members\": [\n \"user:mike@example.com\",\n \"group:admins@example.com\",\n \"domain:google.com\",\n \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"\n ]\n },\n {\n \"role\": \"roles/viewer\",\n \"members\": [\"user:sean@example.com\"]\n }\n ]\n }\n\n**YAML Example** \n\n bindings:\n - members:\n - user:mike@example.com\n - group:admins@example.com\n - domain:google.com\n - serviceAccount:my-other-app@appspot.gserviceaccount.com\n role: roles/owner\n - members:\n - user:sean@example.com\n role: roles/viewer\n\nFor a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs).\n\nBinding\n-------\n\nAssociates `members` with a `role`.\n\nExpr\n----\n\nRepresents an expression text. Example: \n\n title: \"User account presence\"\n description: \"Determines whether the request has a user account\"\n expression: \"size(request.user) \u003e 0\""]]