mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
feat: Able to disable non-admin to create new organization (#927)
This commit is contained in:
parent
23aba523b5
commit
d67b278a0d
7 changed files with 42 additions and 3 deletions
10
cmd/web.go
10
cmd/web.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue