@@ -2583,21 +2583,26 @@ def sample_set_iam_policy():
2583
2583
2584
2584
Returns:
2585
2585
google.iam.v1.policy_pb2.Policy:
2586
- Defines an Identity and Access Management (IAM) policy. It is used to
2587
- specify access control policies for Cloud Platform
2588
- resources.
2586
+ An Identity and Access Management (IAM) policy, which specifies access
2587
+ controls for Google Cloud resources.
2589
2588
2590
2589
A Policy is a collection of bindings. A binding binds
2591
- one or more members to a single role. Members can be
2592
- user accounts, service accounts, Google groups, and
2593
- domains (such as G Suite). A role is a named list of
2594
- permissions (defined by IAM or configured by users).
2595
- A binding can optionally specify a condition, which
2596
- is a logic expression that further constrains the
2597
- role binding based on attributes about the request
2598
- and/or target resource.
2599
-
2600
- **JSON Example**
2590
+ one or more members, or principals, to a single role.
2591
+ Principals can be user accounts, service accounts,
2592
+ Google groups, and domains (such as G Suite). A role
2593
+ is a named list of permissions; each role can be an
2594
+ IAM predefined role or a user-created custom role.
2595
+
2596
+ For some types of Google Cloud resources, a binding
2597
+ can also specify a condition, which is a logical
2598
+ expression that allows access to a resource only if
2599
+ the expression evaluates to true. A condition can add
2600
+ constraints based on attributes of the request, the
2601
+ resource, or both. To learn which resources support
2602
+ conditions in their IAM policies, see the [IAM
2603
+ documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
2604
+
2605
+ **JSON example:**
2601
2606
2602
2607
{
2603
2608
"bindings": [
@@ -2612,17 +2617,17 @@ def sample_set_iam_policy():
2612
2617
2613
2618
}, { "role":
2614
2619
"roles/resourcemanager.organizationViewer",
2615
- "members": ["user:[email protected] "],
2620
+ "members": [ "user:[email protected] " ],
2616
2621
"condition": { "title": "expirable access",
2617
2622
"description": "Does not grant access after
2618
2623
Sep 2020", "expression": "request.time <
2619
2624
timestamp('2020-10-01T00:00:00.000Z')", } }
2620
2625
2621
- ]
2626
+ ], "etag": "BwWWja0YfJA=", "version": 3
2622
2627
2623
2628
}
2624
2629
2625
- **YAML Example **
2630
+ **YAML example: **
2626
2631
2627
2632
bindings: - members: - user:\ [email protected] -
2628
2633
group:\ [email protected] - domain:google.com -
@@ -2633,11 +2638,12 @@ def sample_set_iam_policy():
2633
2638
condition: title: expirable access description:
2634
2639
Does not grant access after Sep 2020 expression:
2635
2640
request.time <
2636
- timestamp('2020-10-01T00:00:00.000Z')
2641
+ timestamp('2020-10-01T00:00:00.000Z') etag:
2642
+ BwWWja0YfJA= version: 3
2637
2643
2638
2644
For a description of IAM and its features, see the
2639
- [IAM developer's
2640
- guide ](\ https://cloud.google.com/iam/docs).
2645
+ [IAM
2646
+ documentation ](\ https://cloud.google.com/iam/docs/ ).
2641
2647
2642
2648
"""
2643
2649
# Create or coerce a protobuf request object.
@@ -2712,21 +2718,26 @@ def sample_get_iam_policy():
2712
2718
2713
2719
Returns:
2714
2720
google.iam.v1.policy_pb2.Policy:
2715
- Defines an Identity and Access Management (IAM) policy. It is used to
2716
- specify access control policies for Cloud Platform
2717
- resources.
2721
+ An Identity and Access Management (IAM) policy, which specifies access
2722
+ controls for Google Cloud resources.
2718
2723
2719
2724
A Policy is a collection of bindings. A binding binds
2720
- one or more members to a single role. Members can be
2721
- user accounts, service accounts, Google groups, and
2722
- domains (such as G Suite). A role is a named list of
2723
- permissions (defined by IAM or configured by users).
2724
- A binding can optionally specify a condition, which
2725
- is a logic expression that further constrains the
2726
- role binding based on attributes about the request
2727
- and/or target resource.
2728
-
2729
- **JSON Example**
2725
+ one or more members, or principals, to a single role.
2726
+ Principals can be user accounts, service accounts,
2727
+ Google groups, and domains (such as G Suite). A role
2728
+ is a named list of permissions; each role can be an
2729
+ IAM predefined role or a user-created custom role.
2730
+
2731
+ For some types of Google Cloud resources, a binding
2732
+ can also specify a condition, which is a logical
2733
+ expression that allows access to a resource only if
2734
+ the expression evaluates to true. A condition can add
2735
+ constraints based on attributes of the request, the
2736
+ resource, or both. To learn which resources support
2737
+ conditions in their IAM policies, see the [IAM
2738
+ documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
2739
+
2740
+ **JSON example:**
2730
2741
2731
2742
{
2732
2743
"bindings": [
@@ -2741,17 +2752,17 @@ def sample_get_iam_policy():
2741
2752
2742
2753
}, { "role":
2743
2754
"roles/resourcemanager.organizationViewer",
2744
- "members": ["user:[email protected] "],
2755
+ "members": [ "user:[email protected] " ],
2745
2756
"condition": { "title": "expirable access",
2746
2757
"description": "Does not grant access after
2747
2758
Sep 2020", "expression": "request.time <
2748
2759
timestamp('2020-10-01T00:00:00.000Z')", } }
2749
2760
2750
- ]
2761
+ ], "etag": "BwWWja0YfJA=", "version": 3
2751
2762
2752
2763
}
2753
2764
2754
- **YAML Example **
2765
+ **YAML example: **
2755
2766
2756
2767
bindings: - members: - user:\ [email protected] -
2757
2768
group:\ [email protected] - domain:google.com -
@@ -2762,11 +2773,12 @@ def sample_get_iam_policy():
2762
2773
condition: title: expirable access description:
2763
2774
Does not grant access after Sep 2020 expression:
2764
2775
request.time <
2765
- timestamp('2020-10-01T00:00:00.000Z')
2776
+ timestamp('2020-10-01T00:00:00.000Z') etag:
2777
+ BwWWja0YfJA= version: 3
2766
2778
2767
2779
For a description of IAM and its features, see the
2768
- [IAM developer's
2769
- guide ](\ https://cloud.google.com/iam/docs).
2780
+ [IAM
2781
+ documentation ](\ https://cloud.google.com/iam/docs/ ).
2770
2782
2771
2783
"""
2772
2784
# Create or coerce a protobuf request object.
0 commit comments