Getting repository collaborators permissions #15332
Labels
issue/duplicate
The issue has already been reported.
modifies/api
This PR adds API routes or modifies them
type/proposal
The new feature has not been accepted yet but needs to be discussed first.
[x]
):Description
Background
For a CI system (gitea, jenkins, k8s) I am creating K8s namespaces based on PRs of a repostory. In these namespaces the application is built and deployed and tested automatically. A user of the CI system should be able to access the PRs namespace for debugging or to change configurations. Such a user needs the appropriate permissions in a namespace in order to view or change something. Currently only the owner of a PR gets access to its namespace by querying the PR via API. We also have situations where a namespace is created for a specific branch (no PRs). But since there is no PR to get the user from, I would like to give repository collaborators with write access to the generated namespace.
But actually the API doesn't provide the needed information (or at least I couldn't find it). When querying
GET /repos/{owner}/{repo}/collaborators
the usualUser
model is returned. It contains theis_admin
property, but it seems this is related to global Gitea administrators.Proposal
Would it be possible to introduce a new Model
Collaborator
inheriting fromUser
which contains a propertypermission
which is either set toview
,write
oradmin
?Currently only the endpoint
GET /repos/{owner}/{repo}/collaborators
is returning collaborators and would be the only one affected by that change.The text was updated successfully, but these errors were encountered: