diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-03-08 21:01:33 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-03-10 10:38:36 -0300 |
commit | c3e70280dffe7ee0859ebd73b902d424ca5f809a (patch) | |
tree | 06b83a5ab13d19803332253cf50a941501b29317 /db | |
parent | bd59e59d01c5e845c7f7d451feaa1488670f20de (diff) | |
download | gitlab-ce-c3e70280dffe7ee0859ebd73b902d424ca5f809a.tar.gz |
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')
-rw-r--r-- | db/migrate/20160308212903_add_default_group_visibility_to_application_settings.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 13 insertions, 1 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 diff --git a/db/schema.rb b/db/schema.rb index d2f311e42da..1d4e18c5f95 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160301124843) do +ActiveRecord::Schema.define(version: 20160308212903) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -75,6 +75,7 @@ ActiveRecord::Schema.define(version: 20160301124843) do t.boolean "akismet_enabled", default: false t.string "akismet_api_key" t.boolean "email_author_in_body", default: false + t.integer "default_group_visibility" end create_table "audit_events", force: :cascade do |t| |