Complete the code to assign a role to a user in GCP IAM.
gcloud projects add-iam-policy-binding my-project --member='user:alice@example.com' --role=[1]
The roles/viewer role grants read-only access, which is a common starting point for IAM permissions.
Complete the code to list IAM policies for a project.
gcloud projects get-iam-policy my-project --format=[1]The json format is commonly used to view IAM policies in a structured way.
Fix the error in the command to remove a role binding from a user.
gcloud projects remove-iam-policy-binding my-project --member=[1] --role=roles/editorThe member must be specified with the prefix user: to identify the type correctly.
Fill both blanks to create a custom IAM role with permissions.
gcloud iam roles create myCustomRole --project=my-project --title='Custom Role' --permissions=[1] --stage=[2]
Custom roles require a comma-separated list of permissions and a valid stage like GA (General Availability).
Fill all three blanks to grant a service account access to a BigQuery dataset.
gcloud projects add-iam-policy-binding my-project --member=[1] --role=[2] --condition=true --condition-title=[3]
The service account is specified with the serviceAccount: prefix, the role roles/bigquery.dataViewer grants read access, and the condition title is a descriptive string.