Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui committed Jan 9, 2020
1 parent ff2667a commit f84ea6f
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions api_core/google/api_core/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,33 @@ def _contains_conditions(self):

@property
def bindings(self):
""":obj:`list` of :obj:`dict`: The policy's bindings list.
"""The policy's list of bindings.
A binding is specified by a dictionary with keys:
role (str): Role that is assigned to `members`.
members (:obj:`set` of str): Specifies the identities associated to this binding.
condition (dict of str:str): Specifies a condition under which this binding will apply.
- title (str): Title for the condition.
- description (:obj:str, optional): Description of the condition.
- expression: A CEL expression.
* role (str): Role that is assigned to `members`.
* members (:obj:`set` of str): Specifies the identities associated to this binding.
* condition (:obj:`dict` of str:str): Specifies a condition under which this binding will apply.
* title (str): Title for the condition.
* description (:obj:str, optional): Description of the condition.
* expression: A CEL expression.
Type:
:obj:`list` of :obj:`dict`
See:
Policy versions https://cloud.google.com/iam/docs/policies#versions
Conditions overview https://cloud.google.com/iam/docs/conditions-overview.
Example:
.. code-block:: python
USER = "user:phred@example.com"
ADMIN_GROUP = "group:admins@groups.example.com"
SERVICE_ACCOUNT = "serviceAccount:account-1234@accounts.example.com"
Expand All @@ -199,10 +210,10 @@ def bindings(self):
policy.version = 3
policy.bindings = [
{
"role": "roles/viewer",
"members": {USER, ADMIN_GROUP, SERVICE_ACCOUNT},
"condition": CONDITION
{
"role": "roles/viewer",
"members": {USER, ADMIN_GROUP, SERVICE_ACCOUNT},
"condition": CONDITION
},
...
]
Expand Down

0 comments on commit f84ea6f

Please sign in to comment.