diff options
author | Dmitry Medvinsky <me@dmedvinsky.name> | 2013-03-11 10:44:45 +0400 |
---|---|---|
committer | Dmitry Medvinsky <me@dmedvinsky.name> | 2013-05-16 18:02:22 +0400 |
commit | 22279bc55870435c61d5e8208cc3117ef2268052 (patch) | |
tree | 1433f090b459f8573619121533546de8c2b32a02 /config/initializers | |
parent | 3e115faafa13a0bcad5458a9632dec909eb376da (diff) |
Add settings for user permission defaults
“Can create groups” and “Can create teams” had hardcoded defaults to
`true`. Sometimes it is desirable to prohibit these for newly created
users by default.
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/1_settings.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 27605efddfe..f85b80f5b79 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -48,7 +48,9 @@ Settings['issues_tracker'] ||= {} # GitLab # Settings['gitlab'] ||= Settingslogic.new({}) -Settings.gitlab['default_projects_limit'] ||= 10 +Settings.gitlab['default_projects_limit'] ||= 10 +Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? +Settings.gitlab['default_can_create_team'] = true if Settings.gitlab['default_can_create_team'].nil? Settings.gitlab['host'] ||= 'localhost' Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 @@ -111,3 +113,12 @@ Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "t # Extra customization # Settings['extra'] ||= Settingslogic.new({}) + +# +# Testing settings +# +if Rails.env.test? + Settings.gitlab['default_projects_limit'] = 42 + Settings.gitlab['default_can_create_group'] = false + Settings.gitlab['default_can_create_team'] = false +end |