Able to disable non-admin to create new organization (#1556)

Add new config option '[admin] DISABLE_REGULAR_ORG_CREATION', by
default it's 'false'.
This commit is contained in:
Unknwon
2017-02-10 16:41:51 -05:00
parent 2c154ccbe7
commit b67ec01d41
7 changed files with 25 additions and 4 deletions

View File

@@ -362,8 +362,14 @@ func runWeb(ctx *cli.Context) error {
// ***** START: Organization *****
m.Group("/org", func() {
m.Get("/create", org.Create)
m.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost)
m.Group("", func() {
m.Get("/create", org.Create)
m.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost)
}, func(ctx *context.Context) {
if !ctx.User.CanCreateOrganization() {
ctx.NotFound()
}
})
m.Group("/:org", func() {
m.Get("/dashboard", user.Dashboard)