|
|
@ -334,7 +334,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
reqRepoAdmin := middleware.RequireRepoAdmin() |
|
|
|
reqRepoAdmin := middleware.RequireRepoAdmin() |
|
|
|
reqRepoPusher := middleware.RequireRepoPusher() |
|
|
|
reqRepoWriter := middleware.RequireRepoWriter() |
|
|
|
|
|
|
|
|
|
|
|
// ***** START: Organization *****
|
|
|
|
// ***** START: Organization *****
|
|
|
|
m.Group("/org", func() { |
|
|
|
m.Group("/org", func() { |
|
|
@ -448,7 +448,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Post("/label", repo.UpdateIssueLabel) |
|
|
|
m.Post("/label", repo.UpdateIssueLabel) |
|
|
|
m.Post("/milestone", repo.UpdateIssueMilestone) |
|
|
|
m.Post("/milestone", repo.UpdateIssueMilestone) |
|
|
|
m.Post("/assignee", repo.UpdateIssueAssignee) |
|
|
|
m.Post("/assignee", repo.UpdateIssueAssignee) |
|
|
|
}, reqRepoAdmin) |
|
|
|
}, reqRepoWriter) |
|
|
|
|
|
|
|
|
|
|
|
m.Group("/:index", func() { |
|
|
|
m.Group("/:index", func() { |
|
|
|
m.Post("/title", repo.UpdateIssueTitle) |
|
|
|
m.Post("/title", repo.UpdateIssueTitle) |
|
|
@ -460,7 +460,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel) |
|
|
|
m.Post("/new", bindIgnErr(auth.CreateLabelForm{}), repo.NewLabel) |
|
|
|
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel) |
|
|
|
m.Post("/edit", bindIgnErr(auth.CreateLabelForm{}), repo.UpdateLabel) |
|
|
|
m.Post("/delete", repo.DeleteLabel) |
|
|
|
m.Post("/delete", repo.DeleteLabel) |
|
|
|
}, reqRepoAdmin, middleware.RepoRef()) |
|
|
|
}, reqRepoWriter, middleware.RepoRef()) |
|
|
|
m.Group("/milestones", func() { |
|
|
|
m.Group("/milestones", func() { |
|
|
|
m.Combo("/new").Get(repo.NewMilestone). |
|
|
|
m.Combo("/new").Get(repo.NewMilestone). |
|
|
|
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost) |
|
|
|
Post(bindIgnErr(auth.CreateMilestoneForm{}), repo.NewMilestonePost) |
|
|
@ -468,7 +468,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost) |
|
|
|
m.Post("/:id/edit", bindIgnErr(auth.CreateMilestoneForm{}), repo.EditMilestonePost) |
|
|
|
m.Get("/:id/:action", repo.ChangeMilestonStatus) |
|
|
|
m.Get("/:id/:action", repo.ChangeMilestonStatus) |
|
|
|
m.Post("/delete", repo.DeleteMilestone) |
|
|
|
m.Post("/delete", repo.DeleteMilestone) |
|
|
|
}, reqRepoAdmin, middleware.RepoRef()) |
|
|
|
}, reqRepoWriter, middleware.RepoRef()) |
|
|
|
|
|
|
|
|
|
|
|
m.Group("/releases", func() { |
|
|
|
m.Group("/releases", func() { |
|
|
|
m.Get("/new", repo.NewRelease) |
|
|
|
m.Get("/new", repo.NewRelease) |
|
|
@ -476,7 +476,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Get("/edit/:tagname", repo.EditRelease) |
|
|
|
m.Get("/edit/:tagname", repo.EditRelease) |
|
|
|
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) |
|
|
|
m.Post("/delete", repo.DeleteRelease) |
|
|
|
m.Post("/delete", repo.DeleteRelease) |
|
|
|
}, reqRepoAdmin, middleware.RepoRef()) |
|
|
|
}, reqRepoWriter, middleware.RepoRef()) |
|
|
|
|
|
|
|
|
|
|
|
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest). |
|
|
|
m.Combo("/compare/*", repo.MustAllowPulls).Get(repo.CompareAndPullRequest). |
|
|
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) |
|
|
|
Post(bindIgnErr(auth.CreateIssueForm{}), repo.CompareAndPullRequestPost) |
|
|
@ -503,7 +503,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Combo("/:page/_edit").Get(repo.EditWiki). |
|
|
|
m.Combo("/:page/_edit").Get(repo.EditWiki). |
|
|
|
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost) |
|
|
|
Post(bindIgnErr(auth.NewWikiForm{}), repo.EditWikiPost) |
|
|
|
m.Post("/:page/delete", repo.DeleteWikiPagePost) |
|
|
|
m.Post("/:page/delete", repo.DeleteWikiPagePost) |
|
|
|
}, reqSignIn, reqRepoPusher) |
|
|
|
}, reqSignIn, reqRepoWriter) |
|
|
|
}, repo.MustEnableWiki, middleware.RepoRef()) |
|
|
|
}, repo.MustEnableWiki, middleware.RepoRef()) |
|
|
|
|
|
|
|
|
|
|
|
m.Get("/archive/*", repo.Download) |
|
|
|
m.Get("/archive/*", repo.Download) |
|
|
@ -511,7 +511,7 @@ func runWeb(ctx *cli.Context) { |
|
|
|
m.Group("/pulls/:index", func() { |
|
|
|
m.Group("/pulls/:index", func() { |
|
|
|
m.Get("/commits", middleware.RepoRef(), repo.ViewPullCommits) |
|
|
|
m.Get("/commits", middleware.RepoRef(), repo.ViewPullCommits) |
|
|
|
m.Get("/files", middleware.RepoRef(), repo.ViewPullFiles) |
|
|
|
m.Get("/files", middleware.RepoRef(), repo.ViewPullFiles) |
|
|
|
m.Post("/merge", reqRepoAdmin, repo.MergePullRequest) |
|
|
|
m.Post("/merge", reqRepoWriter, repo.MergePullRequest) |
|
|
|
}, repo.MustAllowPulls) |
|
|
|
}, repo.MustAllowPulls) |
|
|
|
|
|
|
|
|
|
|
|
m.Group("", func() { |
|
|
|
m.Group("", func() { |
|
|
|