API: No way to find out if user has access to a project
Created by: gubby
There appears to be no way to use the API to answer either of the following questions:
- Which projects does $USER have access to?
- Does $USER have access to $PROJECT?
The endpoint /api/v3/projects/:id/members
lists the users that are directly a member of a given project, but not those that inherit their membership via the project's group.
The workaround is to make quite a few API calls; i.e.:
- Get the group for a project,
- Build the list of users in the group,
- List the direct members of the project,
- Then finally work out the maximum access level granted by both the group and direct project membership for each.
My suggestion would be a parameter to /projects/:id/members
e.g. transitive=true
that then returns the full set of project members that have access to a project.