From a61c19dddcffd7ebffb70305d6a756e147a82c92 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 1 Oct 2014 09:41:57 -0700 Subject: [PATCH] added missing capability item to context to prevent login panic --- server/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/main.go b/server/main.go index 43d2e1a18..eb94c7295 100644 --- a/server/main.go +++ b/server/main.go @@ -25,6 +25,7 @@ import ( "github.com/drone/drone/plugin/remote/github" "github.com/drone/drone/plugin/remote/gitlab" "github.com/drone/drone/server/blobstore" + "github.com/drone/drone/server/capability" "github.com/drone/drone/server/datastore" "github.com/drone/drone/server/datastore/database" "github.com/drone/drone/server/worker/director" @@ -67,6 +68,8 @@ var ( nodes StringArr db *sql.DB + + caps map[string]bool ) func main() { @@ -90,6 +93,9 @@ func main() { github.Register() gitlab.Register() + caps = map[string]bool{} + caps[capability.Registration] = open + // setup the database and cancel all pending // commits in the system. db = database.MustConnect(driver, datasource) @@ -183,6 +189,7 @@ func ContextMiddleware(c *web.C, h http.Handler) http.Handler { ctx = pool.NewContext(ctx, workers) ctx = director.NewContext(ctx, worker) ctx = pubsub.NewContext(ctx, pub) + ctx = capability.NewContext(ctx, caps) // add the context to the goji web context webcontext.Set(c, ctx)