feat: Able to disable non-admin to create new organization (#927)

This commit is contained in:
Bo-Yi Wu
2017-02-14 20:16:00 +08:00
committed by Lunny Xiao
parent 23aba523b5
commit d67b278a0d
7 changed files with 42 additions and 3 deletions

View File

@ -345,8 +345,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)