Skip to content

Commit dbccb05

Browse files
kasbahAbdulrhmnGhanem
authored andcommitted
Allow reading collaborators without API token
1 parent 5d27a8c commit dbccb05

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
@@ -806,9 +806,10 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
806806
m.Post("/tests", context.RepoRefForAPI, repo.TestHook)
807807
})
808808
}, reqToken(), reqAdmin(), reqWebhooksEnabled())
809+
m.Get("/collaborators/{collaborator}", reqAnyRepoReader(), repo.IsCollaborator)
809810
m.Group("/collaborators", func() {
810811
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
811-
m.Combo("/{collaborator}").Get(reqAnyRepoReader(), repo.IsCollaborator).
812+
m.Combo("/{collaborator}").
812813
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
813814
Delete(reqAdmin(), repo.DeleteCollaborator)
814815
}, reqToken())

0 commit comments

Comments
 (0)