Skip to content

Commit 74cc3c5

Browse files
Allow list collaborators for users with Read access to repo (#9995)
Co-authored-by: Lunny Xiao <[email protected]>
1 parent bb4261a commit 74cc3c5

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
@@ -652,11 +652,11 @@ func RegisterRoutes(m *macaron.Macaron) {
652652
}, reqGitHook(), context.ReferencesGitRepo(true))
653653
}, reqToken(), reqAdmin())
654654
m.Group("/collaborators", func() {
655-
m.Get("", repo.ListCollaborators)
656-
m.Combo("/:collaborator").Get(repo.IsCollaborator).
657-
Put(bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
658-
Delete(repo.DeleteCollaborator)
659-
}, reqToken(), reqAdmin())
655+
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
656+
m.Combo("/:collaborator").Get(reqAnyRepoReader(), repo.IsCollaborator).
657+
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
658+
Delete(reqAdmin(), repo.DeleteCollaborator)
659+
}, reqToken())
660660
m.Get("/raw/*", context.RepoRefByType(context.RepoRefAny), reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
661661
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
662662
m.Combo("/forks").Get(repo.ListForks).

0 commit comments

Comments
 (0)