aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorShashvat Kedia <shashvat51@gmail.com>2020-04-21 20:52:04 +0530
committerGitHub <noreply@github.com>2020-04-21 11:22:04 -0400
commit74cc3c5e18083ef65699c4c0268cea6c7f5781b5 (patch)
tree38b48d22371a3b9b790da3a9fede59d889d1a398 /routers
parentbb4261a5ed678235fadef279fe1ba1505993a406 (diff)
downloadgitea-74cc3c5e18083ef65699c4c0268cea6c7f5781b5.tar.gz
gitea-74cc3c5e18083ef65699c4c0268cea6c7f5781b5.zip
Allow list collaborators for users with Read access to repo (#9995)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/api.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 4b20c3e7c0..cd451c1d5b 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -652,11 +652,11 @@ func RegisterRoutes(m *macaron.Macaron) {
}, reqGitHook(), context.ReferencesGitRepo(true))
}, reqToken(), reqAdmin())
m.Group("/collaborators", func() {
- m.Get("", repo.ListCollaborators)
- m.Combo("/:collaborator").Get(repo.IsCollaborator).
- Put(bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
- Delete(repo.DeleteCollaborator)
- }, reqToken(), reqAdmin())
+ m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
+ m.Combo("/:collaborator").Get(reqAnyRepoReader(), repo.IsCollaborator).
+ Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
+ Delete(reqAdmin(), repo.DeleteCollaborator)
+ }, reqToken())
m.Get("/raw/*", context.RepoRefByType(context.RepoRefAny), reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
m.Combo("/forks").Get(repo.ListForks).