Allow list collaborators for users with Read access to repo (#9995)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
bb4261a5ed
commit
74cc3c5e18
1 changed files with 5 additions and 5 deletions
|
@ -652,11 +652,11 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
}, reqGitHook(), context.ReferencesGitRepo(true))
|
}, reqGitHook(), context.ReferencesGitRepo(true))
|
||||||
}, reqToken(), reqAdmin())
|
}, reqToken(), reqAdmin())
|
||||||
m.Group("/collaborators", func() {
|
m.Group("/collaborators", func() {
|
||||||
m.Get("", repo.ListCollaborators)
|
m.Get("", reqAnyRepoReader(), repo.ListCollaborators)
|
||||||
m.Combo("/:collaborator").Get(repo.IsCollaborator).
|
m.Combo("/:collaborator").Get(reqAnyRepoReader(), repo.IsCollaborator).
|
||||||
Put(bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
|
Put(reqAdmin(), bind(api.AddCollaboratorOption{}), repo.AddCollaborator).
|
||||||
Delete(repo.DeleteCollaborator)
|
Delete(reqAdmin(), repo.DeleteCollaborator)
|
||||||
}, reqToken(), reqAdmin())
|
}, reqToken())
|
||||||
m.Get("/raw/*", context.RepoRefByType(context.RepoRefAny), reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
|
m.Get("/raw/*", context.RepoRefByType(context.RepoRefAny), reqRepoReader(models.UnitTypeCode), repo.GetRawFile)
|
||||||
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
|
m.Get("/archive/*", reqRepoReader(models.UnitTypeCode), repo.GetArchive)
|
||||||
m.Combo("/forks").Get(repo.ListForks).
|
m.Combo("/forks").Get(repo.ListForks).
|
||||||
|
|
Reference in a new issue