gitea
gitea copied to clipboard
collaborators API endpoint does not list team members in a repo owned by an organization
Description
In a repository owned by an organization, when using the API endpoint /repos/ORG/REPO/collaborators
, only individual collaborators are listed. The API response should include the list of users who are members of teams assigned to the repository.
This would match the display of the web page ORG/REPO/settings/collaboration
, as well as GitHub's API behavior.
This is a severe limitation which prevents me from properly using the Jenkins Gitea plugin (which queries the collaborators API endpoint for trust policy checks). I could in theory circumvent the issue by manually adding individuals to the list of collaborators, but I cannot do that for myself as I am in the Owners group of the organization (thus I receive the error message Cannot add an owner as a collaborator.
)
At the very least, repository owners should be listed as collaborators.
I don't seem to be able to create an organization on the test instance, so I can't reproduce the issue there.
Gitea Version
1.21.11
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
Ubuntu 22.04
How are you running Gitea?
I used the 1.21.11 linux-amd64 build from dl.gitea.com
Database
MySQL/MariaDB