Skip to content

Commit eecfe20

Browse files
committed
Allow reading collaborators without API token
1 parent ca6c52b commit eecfe20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

routers/api/v1/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,10 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
762762
m.Post("/tests", context.RepoRefForAPI, repo.TestHook)
763763
})
764764
}, reqToken(), reqAdmin(), reqWebhooksEnabled())
765+
m.Get("/collaborators/{collaborator}", reqAnyRepoReader(), repo.IsCollaborator)
765766
m.Group("/collaborators", func() {
766767
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
767-
m.Combo("/{collaborator}").Get(reqAnyRepoReader(), repo.IsCollaborator).
768+
m.Combo("/{collaborator}").
768769
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
769770
Delete(reqAdmin(), repo.DeleteCollaborator)
770771
}, reqToken())

0 commit comments

Comments
 (0)