-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
proposal: API for querying collaborator permissions #14936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
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.
Milestone
Comments
|
lol this was one of my first prs that was rejected as it changed the api... |
6 tasks
flozzone
added a commit
to flozzone/gitea
that referenced
this issue
Apr 27, 2022
6543
pushed a commit
that referenced
this issue
Apr 29, 2022
Targeting #14936, #15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. ### Checks the repository permissions of a collaborator. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
-> #18761 |
Gusted
pushed a commit
to Gusted/gitea
that referenced
this issue
Apr 30, 2022
…18761) Targeting go-gitea#14936, go-gitea#15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. ### Checks the repository permissions of a collaborator. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
AbdulrhmnGhanem
pushed a commit
to kitspace/gitea
that referenced
this issue
Aug 24, 2022
…18761) Targeting go-gitea#14936, go-gitea#15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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
Context: I have defined a team with
can_create_org_repo
and write permission to all repos. Team members are considered maintainers/contacts for the repositories they have admin privileges on. Now I want other members of the same team to be able to query (via a custom client) the admin(s) of a given repo.In the GitHub API,
GET /repos/{owner}/{repo}/collaborators
returns the permissions of each collaborator along with the user info, e.g."permissions": { "pull": true, "push": true, "admin": false }
. I think this would be the preferred way of implementing this feature.Possible alternatives:
GET /repos/{owner}/{repo}/collaborators/{username}/permission
- less efficient in this use case, because it would require multiple requestsGET /repos/{owner}/{repo}/collaborators
by their permissions using an optional parameter - would deviate from the GitHub APIGET /repos/{owner}/{repo}/permissions
for querying collaborator permissions - would deviate from the GitHub APIScreenshots
The text was updated successfully, but these errors were encountered: