Skip to content

Commit 2ac5009

Browse files
Allow list collaborators for users with Read access to repo
1 parent 71d5a09 commit 2ac5009

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

routers/api/v1/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ func RegisterRoutes(m *macaron.Macaron) {
643643
}, reqGitHook(), context.ReferencesGitRepo(true))
644644
}, reqToken(), reqAdmin())
645645
m.Group("/collaborators", func() {
646-
m.Get("", repo.ListCollaborators)
647-
m.Combo("/:collaborator").Get(repo.IsCollaborator).
648-
Put(bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
649-
Delete(repo.DeleteCollaborator)
650-
}, reqToken(), reqAdmin())
646+
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
647+
m.Combo("/:collaborator").Get(reqAnyRepoReader(), repo.IsCollaborator).
648+
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
649+
Delete(reqAdmin(), repo.DeleteCollaborator)
650+
}, reqToken())
651651
m.Get("/raw/*", context.RepoRefByType(context.RepoRefAny), reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
652652
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
653653
m.Combo("/forks").Get(repo.ListForks).

0 commit comments

Comments
 (0)