forgejo/routers/api/v1
Florin Hillebrand ad6d08d155
Add API to query collaborators permission for a repository (#18761)
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.
2022-04-29 14:24:38 +02:00
..
admin Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
misc Remove dependent on session auth for api/v1 routers (#19321) 2022-04-08 06:22:10 +02:00
notify Never use /api/v1 from Gitea UI Pages (#19318) 2022-04-07 20:59:56 +02:00
org Fix panic in team repos API (#19431) 2022-04-20 18:43:26 +08:00
packages Add Helm Chart registry (#19406) 2022-04-19 12:55:35 -04:00
repo Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
settings Make mirror feature more configurable (#16957) 2021-09-07 17:49:36 +02:00
swagger Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
user Fix DELETE request for non-existent public key (#19443) 2022-04-21 03:08:30 +02:00
utils Never use /api/v1 from Gitea UI Pages (#19318) 2022-04-07 20:59:56 +02:00
api.go Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
auth.go Let web and API routes have different auth methods group (#19168) 2022-03-28 12:46:28 +08:00
auth_windows.go Let web and API routes have different auth methods group (#19168) 2022-03-28 12:46:28 +08:00