Add configuration option for default permission to create Organizations (#1686)

This commit is contained in:
Lauris BH 2017-05-08 22:51:53 +03:00 committed by Kim "BKC" Carlbäcker
parent a85c5ab9ff
commit 51d0becb42
13 changed files with 27 additions and 5 deletions

View file

@ -45,6 +45,7 @@ type InstallForm struct {
EnableCaptcha bool
RequireSignInView bool
DefaultKeepEmailPrivate bool
DefaultAllowCreateOrganization bool
NoReplyAddress string
AdminName string `binding:"OmitEmpty;AlphaDashDot;MaxSize(30)" locale:"install.admin_name"`

View file

@ -972,6 +972,7 @@ var Service struct {
EnableReverseProxyAutoRegister bool
EnableCaptcha bool
DefaultKeepEmailPrivate bool
DefaultAllowCreateOrganization bool
NoReplyAddress string
// OpenID settings
@ -992,6 +993,7 @@ func newService() {
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()
Service.EnableCaptcha = sec.Key("ENABLE_CAPTCHA").MustBool()
Service.DefaultKeepEmailPrivate = sec.Key("DEFAULT_KEEP_EMAIL_PRIVATE").MustBool()
Service.DefaultAllowCreateOrganization = sec.Key("DEFAULT_ALLOW_CREATE_ORGANIZATION").MustBool(true)
Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply.example.org")
sec = Cfg.Section("openid")