summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorRémy Boulanouar <rboulanouar@gmail.com>2019-02-18 17:00:27 +0100
committerLauris BH <lauris@nix.lv>2019-02-18 18:00:27 +0200
commit64ce159a6eacc81962d07a8f5ef7f69c17365363 (patch)
treed6b94d035de14df8b1a773d97ab35937cce1d00a /modules/setting
parentae3a913122d3430ccf14da22f09daf6f636a00f8 (diff)
downloadgitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.tar.gz
gitea-64ce159a6eacc81962d07a8f5ef7f69c17365363.zip
Allow to set organization visibility (public, internal, private) (#1763)
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/service.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/setting/service.go b/modules/setting/service.go
index 4b9ddb055b..08bfb6c414 100644
--- a/modules/setting/service.go
+++ b/modules/setting/service.go
@@ -4,10 +4,16 @@
package setting
-import "regexp"
+import (
+ "regexp"
+
+ "code.gitea.io/gitea/modules/structs"
+)
// Service settings
var Service struct {
+ DefaultOrgVisibility string
+ DefaultOrgVisibilityMode structs.VisibleType
ActiveCodeLives int
ResetPwdCodeLives int
RegisterEmailConfirm bool
@@ -68,6 +74,8 @@ func newService() {
Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply.example.org")
Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true)
Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true)
+ Service.DefaultOrgVisibility = sec.Key("DEFAULT_ORG_VISIBILITY").In("public", structs.ExtractKeysFromMapString(structs.VisibilityModes))
+ Service.DefaultOrgVisibilityMode = structs.VisibilityModes[Service.DefaultOrgVisibility]
sec = Cfg.Section("openid")
Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(!InstallLock)