Closed
Description
- Gitea version (or commit ref): 1.13.4
- Git version: N/A
- Operating system: Linux (Official Docker Image)
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL) https://try.gitea.io/org/collab_perms/teams/users
- No
- Log gist:
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