I am interested in listing all the roles & permissions a user has been assigned including custom roles through the Google Cloud SDK.
In CLI, I ran the following command but it lists all the roles available in the project without respecting the filter. It also doesn't list the custom roles.
gcloud projects get-iam-policy my-project-id --filter="bindings.members:user@company.com"
Alternatively, can I list all the users under a custom role?
Hello vinaypotluri,
Here is a documentation from Stack Exchange provided by manasouza
"
That can be achieved using another gcloud
command:
gcloud beta asset search-all-iam-policies --query policy:"roles/owner" --project $your_project_id --flatten="results[].policy[]" --format="csv(bindings.members[0])"
"