summaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
Diffstat (limited to 'web.go')
-rw-r--r--web.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/web.go b/web.go
index 4a49a44843..13af425b93 100644
--- a/web.go
+++ b/web.go
@@ -144,22 +144,24 @@ func runWeb(*cli.Context) {
m.Get("/template/**", dev.TemplatePreview)
}
+ writeable := middleware.WriteAccess()
+
m.Group("/:username/:reponame", func(r martini.Router) {
- r.Post("/settings", repo.SettingPost)
- r.Get("/settings", repo.Setting)
+ r.Get("/settings", writeable, repo.Setting)
+ r.Post("/settings", writeable, repo.SettingPost)
r.Get("/action/:action", repo.Action)
r.Get("/issues/new", repo.CreateIssue)
r.Post("/issues/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost)
r.Post("/issues/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
r.Post("/comment/:action", repo.Comment)
- r.Post("/import", repo.Import)
+ r.Post("/import", writeable, repo.Import)
}, reqSignIn, middleware.RepoAssignment(true))
m.Group("/:username/:reponame", func(r martini.Router) {
r.Get("/issues", repo.Issues)
r.Get("/issues/:index", repo.ViewIssue)
r.Get("/releases", repo.Releases)
- r.Any("/releases/new", repo.ReleasesNew) // TODO:
+ r.Any("/releases/new", writeable, repo.ReleasesNew) // TODO:
r.Get("/pulls", repo.Pulls)
r.Get("/branches", repo.Branches)
}, ignSignIn, middleware.RepoAssignment(true))
@@ -175,8 +177,8 @@ func runWeb(*cli.Context) {
}, ignSignIn, middleware.RepoAssignment(true, true))
m.Group("/:username", func(r martini.Router) {
- r.Any("/:reponame/**", repo.Http)
r.Get("/:reponame", middleware.RepoAssignment(true, true, true), repo.Single)
+ r.Any("/:reponame/**", repo.Http)
}, ignSignInAndCsrf)
// Not found handler.