summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-05-08 22:51:53 +0300
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-05-08 21:51:53 +0200
commit51d0becb4232eab6b18959ccc4a895e5df30c4dc (patch)
treed119ca2bef3ca44147801cd57e4cf2190690f65a /modules
parenta85c5ab9ff60dab58b2bf713479460caac8e9567 (diff)
downloadgitea-51d0becb4232eab6b18959ccc4a895e5df30c4dc.tar.gz
gitea-51d0becb4232eab6b18959ccc4a895e5df30c4dc.zip
Add configuration option for default permission to create Organizations (#1686)
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/user_form.go1
-rw-r--r--modules/setting/setting.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index 9e19c78a45..ea6e464a7f 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -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"`
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index a00db16d3a..c3ed4ef971 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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")