You have recently been put in charge of managing identity and access management for your organization. You have several projects and want to use scripting and automation wherever possible. You want to grant the editor role to a project member.
Which two methods can you use to accomplish this? (Choose two.)
A. GetIamPolicy() via REST API
B. setIamPolicy() via REST API
C. gcloud pubsub add-iam-policy-binding Sprojectname –member user:Susername –role roles/editor
D. gcloud projects add-iam-policy-binding Sprojectname –member user:Susername –role roles/editor
E. Enter an email address in the Add members field, and select the desired role from the drop-down menu in the GCP Console.
I think B is incorrect.
Because:
“CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings.”
Ref:
https://cloud.google.com/resource-manager/reference/rest/v1/projects/setIamPolicy
D and E , API is for service account.
B and D