Skip to content

API endpoint that returns all members, including the inherited membership through ancestor group

Current behavior

I've created nested groups:

  • springfield:
    • Members: quimby as Owner
    • Subgroup: evergreen-terrace
      • Members: neddie as Owner
      • Subgroups: 742
        • Members: homer as Owner

On the groups page/groups/springfield/evergreen-terrace/742/group_members I see this:

Screen_Shot_2017-05-23_at_14.51.25

When I query the members for the same group from the API /api/v4/groups/springfield%2fevergreen-terrace%2f742/members, I get this (filtered):

[
  {
    "username": "homer",
    "name": "Homer J. Simpson"
  },
  {
    "username": "root",
    "name": "Administrator"
  }
]

So owners of parent groups not are returned by the API.

Proposal

Add new endpoints, like /api/v4/groups/:id/members/all and /api/v4/projects/:id/members/all, that return all the members of the group/project, including those who gained membership through ancestor group.

cc @dzaporozhets

Edited by Toon Claes