diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-09 03:01:33 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-10 16:38:36 +0300 |
commit | c3e70280dffe7ee0859ebd73b902d424ca5f809a (patch) | |
tree | 06b83a5ab13d19803332253cf50a941501b29317 /db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb | |
parent | bd59e59d01c5e845c7f7d451feaa1488670f20de (diff) |
Prevent projects to have higher visibility than groups
Prevent Groups to have smaller visibility than projects
Add default_group_visibility_level to configuration
Code improvements
Diffstat (limited to 'db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb')
-rw-r--r-- | db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb new file mode 100644 index 00000000000..c2bdd7b31fa --- /dev/null +++ b/db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb @@ -0,0 +1,11 @@ +class AddDefaultGroupVisibilityToApplicationSettings < ActiveRecord::Migration + def up + add_column :application_settings, :default_group_visibility, :integer + visibility = Settings.gitlab.default_groups_features['visibility_level'] + execute("update application_settings set default_group_visibility = #{visibility}") + end + + def down + remove_column :application_settings, :default_group_visibility + end +end |