Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGeorge Koltsov <koltsov.george@gmail.com>2019-07-19 06:00:23 +0300
committerEvan Read <eread@gitlab.com>2019-07-19 06:00:23 +0300
commit9ef196b7a7d51043c09c848699f7d393edf7af03 (patch)
treeffecebd027d122e197e46f626ff40d118491f06f /lib
parent0da7c9250880b508c49baa94cfa18398771f3add (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.rb1
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