diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-11 21:47:39 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-11 21:47:39 -0400 |
commit | 33aa4f74380ab117673a1cc30bead3a7f2b3cb4b (patch) | |
tree | ac6c7c1ebebb86260545386c7ce923593e4d5046 /web.go | |
parent | d6dac160dfcac068b31bda9316ddc3d4919e3288 (diff) | |
download | gitea-33aa4f74380ab117673a1cc30bead3a7f2b3cb4b.tar.gz gitea-33aa4f74380ab117673a1cc30bead3a7f2b3cb4b.zip |
Support private repo
Diffstat (limited to 'web.go')
-rw-r--r-- | web.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -156,22 +156,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)) @@ -187,8 +189,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. |