Getting repository collaborators permissions #7130

Closed
opened 2025-11-02 07:16:29 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @flozzone on GitHub (Apr 7, 2021).

  • Gitea version (or commit ref): 1.13.3
  • Operating system: docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No

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 usual User model is returned. It contains the is_admin property, but it seems this is related to global Gitea administrators.

Proposal

Would it be possible to introduce a new Model Collaborator inheriting from User which contains a property permission which is either set to view, write or admin?

Currently only the endpoint GET /repos/{owner}/{repo}/collaborators is returning collaborators and would be the only one affected by that change.

Originally created by @flozzone on GitHub (Apr 7, 2021). - Gitea version (or commit ref): 1.13.3 - Operating system: docker - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No ## 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 usual `User` model is returned. It contains the `is_admin` property, but it seems this is related to global Gitea administrators. ### Proposal Would it be possible to introduce a new Model `Collaborator` inheriting from `User` which contains a property `permission` which is either set to `view`, `write` or `admin`? Currently only the endpoint `GET /repos/{owner}/{repo}/collaborators` is returning collaborators and would be the only one affected by that change.
GiteaMirror added the type/proposalmodifies/apiissue/duplicate labels 2025-11-02 07:16:29 -06:00
Author
Owner

@qwerty287 commented on GitHub (Oct 27, 2021):

Duplicate of #14936?

@qwerty287 commented on GitHub (Oct 27, 2021): Duplicate of #14936?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7130