File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/google-cloud-pubsub/samples/snippets Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ def set_topic_policy(project_id: str, topic_id: str) -> None:
8181 policy = client .get_iam_policy (request = {"resource" : topic_path })
8282
8383 # Add all users as viewers.
84- policy .bindings .add (role = "roles/pubsub.viewer" , members = ["allUsers " ])
84+ policy .bindings .add (role = "roles/pubsub.viewer" , members = ["domain:google.com " ])
8585
8686 # Add a group as a publisher.
8787 policy .bindings .add (
@@ -110,7 +110,7 @@ def set_subscription_policy(project_id: str, subscription_id: str) -> None:
110110 policy = client .get_iam_policy (request = {"resource" : subscription_path })
111111
112112 # Add all users as viewers.
113- policy .bindings .add (role = "roles/pubsub.viewer" , members = ["allUsers " ])
113+ policy .bindings .add (role = "roles/pubsub.viewer" , members = ["domain:google.com " ])
114114
115115 # Add a group as an editor.
116116 policy .bindings .add (role = "roles/editor" , members = ["group:cloud-logs@google.com" ])
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ def test_set_topic_policy(
9898 iam .set_topic_policy (PROJECT_ID , TOPIC_ID )
9999 policy = publisher_client .get_iam_policy (request = {"resource" : topic_path })
100100 assert "roles/pubsub.publisher" in str (policy )
101- assert "allUsers " in str (policy )
101+ assert "domain:google.com " in str (policy )
102102
103103
104104def test_set_subscription_policy (
@@ -107,7 +107,7 @@ def test_set_subscription_policy(
107107 iam .set_subscription_policy (PROJECT_ID , SUBSCRIPTION_ID )
108108 policy = subscriber_client .get_iam_policy (request = {"resource" : subscription_path })
109109 assert "roles/pubsub.viewer" in str (policy )
110- assert "allUsers " in str (policy )
110+ assert "domain:google.com " in str (policy )
111111
112112
113113def test_check_topic_permissions (topic_path : str , capsys : CaptureFixture ) -> None :
You can’t perform that action at this time.
0 commit comments