Skip to content

proposal: API for querying collaborator permissions #14936

Closed
@nome

Description

@nome

Description

Context: I have defined a team with can_create_org_repo and write permission to all repos. Team members are considered maintainers/contacts for the repositories they have admin privileges on. Now I want other members of the same team to be able to query (via a custom client) the admin(s) of a given repo.

In the GitHub API, GET /repos/{owner}/{repo}/collaborators returns the permissions of each collaborator along with the user info, e.g. "permissions": { "pull": true, "push": true, "admin": false }. I think this would be the preferred way of implementing this feature.

Possible alternatives:

  • GET /repos/{owner}/{repo}/collaborators/{username}/permission - less efficient in this use case, because it would require multiple requests
  • Filter collaborators returned in GET /repos/{owner}/{repo}/collaborators by their permissions using an optional parameter - would deviate from the GitHub API
  • Add a separate endpoint, e.g. GET /repos/{owner}/{repo}/permissions for querying collaborator permissions - would deviate from the GitHub API

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions