diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-23 12:34:41 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-23 12:34:41 +0200 |
commit | 556881964fb8137561e9f381d4a5aaef97627cc5 (patch) | |
tree | 32aebddd8c123c540cf04ac6dfd0e503450d9247 /cmd | |
parent | aa68e86206d7d9fc74de8630acfa07dfd7f1bc95 (diff) | |
parent | ee68a826a55c6a4305e7f609db57501a54a5bc47 (diff) | |
download | gitea-556881964fb8137561e9f381d4a5aaef97627cc5.tar.gz gitea-556881964fb8137561e9f381d4a5aaef97627cc5.zip |
Merge branch 'access' into access_rewriteserv
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/web.go b/cmd/web.go index 3284acb9df..8213baab2c 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -79,7 +79,7 @@ func checkVersion() { // Check dependency version. checkers := []VerChecker{ {"github.com/Unknwon/macaron", macaron.Version, "0.5.1"}, - {"github.com/macaron-contrib/binding", binding.Version, "0.0.4"}, + {"github.com/macaron-contrib/binding", binding.Version, "0.0.5"}, {"github.com/macaron-contrib/cache", cache.Version, "0.0.7"}, {"github.com/macaron-contrib/csrf", csrf.Version, "0.0.3"}, {"github.com/macaron-contrib/i18n", i18n.Version, "0.0.5"}, @@ -166,12 +166,11 @@ func newMacaron() *macaron.Macaron { } func runWeb(ctx *cli.Context) { - checkVersion() - if ctx.IsSet("config") { setting.CustomConf = ctx.String("config") } routers.GlobalInit() + checkVersion() m := newMacaron() @@ -230,7 +229,7 @@ func runWeb(ctx *cli.Context) { }) m.Any("/*", func(ctx *middleware.Context) { - ctx.JSON(404, &base.ApiJsonErr{"Not Found", base.DOC_URL}) + ctx.HandleAPI(404, "Page not found") }) }) }) @@ -319,7 +318,7 @@ func runWeb(ctx *cli.Context) { m.Get("/template/*", dev.TemplatePreview) } - reqTrueOwner := middleware.RequireTrueOwner() + reqAdmin := middleware.RequireAdmin() // Organization. m.Group("/org", func() { @@ -394,7 +393,7 @@ func runWeb(ctx *cli.Context) { m.Post("/:name", repo.GitHooksEditPost) }, middleware.GitHookService()) }) - }, reqSignIn, middleware.RepoAssignment(true), reqTrueOwner) + }, reqSignIn, middleware.RepoAssignment(true), reqAdmin) m.Group("/:username/:reponame", func() { m.Get("/action/:action", repo.Action) |