Skip to content

Commit 7819113

Browse files
Update AddBinding.java
Includes changing "member" to "principal" and linking to principal identifiers page instead of specifying recommended format. melaniedejong-patch-1 (#4895)
1 parent 0a34be5 commit 7819113

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

iam/snippets/src/main/java/AddBinding.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ public static void main(String[] args) {
2727
Policy policy = Policy.newBuilder().build();
2828
// TODO: Replace with your role.
2929
String role = "roles/role-to-add";
30-
// TODO: Replace with your members.
31-
List<String> members = Collections.singletonList("user:member-to-add@example.com");
30+
// TODO: Replace with your principals.
31+
// For examples, see https://cloud.google.com/iam/docs/principal-identifiers
32+
List<String> members = Collections.singletonList("principal-id");
3233

3334
addBinding(policy, role, members);
3435
}
3536

36-
// Adds a member to a role.
37+
// Adds a principals to a role.
3738
public static Policy addBinding(Policy policy, String role, List<String> members) {
3839
Binding binding = Binding.newBuilder()
3940
.setRole(role)

0 commit comments

Comments
 (0)