I have a service account which belongs to a project. It have some roles/permissions set at the project level as well as some roles/permissions set at organization level.
I need to get list of all permissions/roles that the service account is granted.
On searching I found "Identity and Access Management (IAM) API" documentation which have API that will list all resources that have access to the service account and the roles set to the resources. What I need is the reverse. I want to get all roles that the service account have on other resources (in my case project and the organization).
In that document it is mentioned "projects.serviceAccounts.getIamPolicy() method does not return what resources the service account has access to. To see if a service account has access to a resource, call the getIamPolicy method on the target resource. For example, to view grants for a project, call the projects.getIamPolicy method." But to get organization level permissions, the service account do not have permission to do the API call.
Is there any other way to get all roles a service account have on a project and organization.