Skip to content

Getting repository collaborators permissions #15332

Closed
@flozzone

Description

@flozzone
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/duplicateThe issue has already been reported.modifies/apiThis PR adds API routes or modifies themtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions