collaborators API endpoint does not list team members in a repo owned by an organization #12979

Open
opened 2025-11-02 10:26:53 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @na-Itms on GitHub (May 9, 2024).

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

Originally created by @na-Itms on GitHub (May 9, 2024). ### 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
GiteaMirror added the topic/apitype/bug labels 2025-11-02 10:26:53 -06:00
Author
Owner

@StanleySweet commented on GitHub (Nov 24, 2024):

Any news?

@StanleySweet commented on GitHub (Nov 24, 2024): Any news?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12979