Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9389

Closed
Open
Created Jun 13, 2015 by Administrator@rootOwner

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.:

  1. Get the group for a project,
  2. Build the list of users in the group,
  3. List the direct members of the project,
  4. 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.

Assignee
Assign to
Time tracking