Add can_leave property to Graphql and children.json APIs

What does this MR do and why?

Needed for #556528

We want to add a Leave project quick action to the project list views. This MR adds a canLeave field to the GraphQL and internal REST APIs that are used on the list views.

Changelog: added

References

Screenshots or screen recordings

Screenshot_2025-12-10_at_9.23.40_AM

How to set up and validate locally

GraphQL

  1. Go to http://gdk.test:3000/-/graphql-explorer
  2. Run the following query
query {
  projects {
    nodes {
      id
      nameWithNamespace
      userPermissions {
        canLeave
      }
    }
  }
}

Internal REST API

  1. Go to a group with a project in it
  2. In the dev tools network tab inspect the groups/<group path>/-/children.json request

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Hegman

Merge request reports

Loading