diff options
author | George Koltsov <koltsov.george@gmail.com> | 2019-07-19 06:00:23 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2019-07-19 06:00:23 +0300 |
commit | 9ef196b7a7d51043c09c848699f7d393edf7af03 (patch) | |
tree | ffecebd027d122e197e46f626ff40d118491f06f /lib | |
parent | 0da7c9250880b508c49baa94cfa18398771f3add (diff) |
Set Private visibility for restricted Internal imported projects
With https://gitlab.com/gitlab-org/gitlab-ee/issues/12388 change going
live there is potential risk of breaking imports of 'Internal' projects.
This change makes sure if 'Internal' visibility level is restricted
all 'Internal' projects will be marked as 'Private'
See: https://gitlab.com/gitlab-org/gitlab-ce/issues/64311
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/import_export/project_tree_restorer.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb index dec99c23a2d..91fe4e5d074 100644 --- a/lib/gitlab/import_export/project_tree_restorer.rb +++ b/lib/gitlab/import_export/project_tree_restorer.rb @@ -130,6 +130,7 @@ module Gitlab def visibility_level level = override_params['visibility_level'] || json_params['visibility_level'] || @project.visibility_level level = @project.group.visibility_level if @project.group && level.to_i > @project.group.visibility_level + level = Gitlab::VisibilityLevel::PRIVATE if level == Gitlab::VisibilityLevel::INTERNAL && Gitlab::CurrentSettings.restricted_visibility_levels.include?(level) { 'visibility_level' => level } end |