Skip to content

Commit

Permalink
Allow list collaborators for users with Read access to repo (#9995)
Browse files Browse the repository at this point in the history
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
shashvat-kedia and lunny committed Apr 21, 2020
1 parent bb4261a commit 74cc3c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routers/api/v1/api.go
Expand Up @@ -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).
Expand Down

0 comments on commit 74cc3c5

Please sign in to comment.