0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-13 14:19:46 +01:00
gitea/modules/structs
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_user.go
attachment.go
commit_status.go
cron.go
doc.go
fork.go - name: new parameter in CreateForkOption to give the forked repository (#18066) 2021-12-24 22:43:00 +08:00
git_blob.go
git_hook.go
hook.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
issue_comment.go Add API to get issue/pull comments and events (timeline) (#17403) 2022-01-01 22:12:25 +08:00
issue_label.go
issue_milestone.go
issue_reaction.go
issue_stopwatch.go
issue_tracked_time.go
issue.go Add option to define refs in issue templates (#17842) 2021-12-17 21:29:09 +00:00
lfs_lock.go
miscellaneous.go
nodeinfo.go
notifications.go API: add html urls to notification subjects (#17178) 2021-09-30 07:17:39 +03:00
org_member.go
org_team.go Team permission allow different unit has different permission (#17811) 2022-01-05 11:37:00 +08:00
org_type.go
org.go Fix various typos (#18219) 2022-01-10 17:32:37 +08:00
package.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
pull_review.go
pull.go Add "Allow edits from maintainer" feature (#18002) 2022-04-28 17:45:33 +02:00
release.go
repo_branch.go
repo_collaborator.go Add API to query collaborators permission for a repository (#18761) 2022-04-29 14:24:38 +02:00
repo_commit.go More commit info from API (#19252) 2022-03-29 10:47:44 -05:00
repo_file.go Add "Allow edits from maintainer" feature (#18002) 2022-04-28 17:45:33 +02:00
repo_key.go
repo_note.go
repo_refs.go
repo_tag.go
repo_topic.go
repo_tree.go
repo_watch.go
repo_wiki.go Add API to get/edit wiki (#17278) 2021-10-25 11:43:40 +08:00
repo.go When updating mirror repo intervals by API reschedule next update too (#19429) 2022-04-20 09:20:53 +01:00
settings.go
status.go
task.go
user_app.go
user_email.go
user_gpgkey.go
user_key.go
user.go