gitea/routers/api/v1/repo
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
..
blob.go
branch.go Don't error when branch's commit doesn't exist (#19547) 2022-04-29 16:44:40 +08:00
collaborators.go Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
commits.go Pass gitRepo down to GetRawDiff, since its used for main repo and wiki (#19461) 2022-04-25 20:45:18 +02:00
file.go Add "Allow edits from maintainer" feature (#18002) 2022-04-28 17:45:33 +02:00
fork.go
git_hook.go
git_ref.go
hook.go
hook_test.go
issue.go
issue_comment.go more context for models (#19511) 2022-04-28 13:48:48 +02:00
issue_label.go
issue_reaction.go
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go
key.go
label.go
language.go
main_test.go Use queue instead of memory queue in webhook send service (#19390) 2022-04-25 20:03:01 +02:00
migrate.go
milestone.go
mirror.go
notes.go
patch.go Add "Allow edits from maintainer" feature (#18002) 2022-04-28 17:45:33 +02:00
pull.go Add "Allow edits from maintainer" feature (#18002) 2022-04-28 17:45:33 +02:00
pull_review.go more context for models (#19511) 2022-04-28 13:48:48 +02:00
release.go
release_attachment.go
release_tags.go
repo.go more context for models (#19511) 2022-04-28 13:48:48 +02:00
repo_test.go
star.go
status.go
subscriber.go
tag.go
teams.go
topic.go
transfer.go
tree.go
wiki.go