From 9ef196b7a7d51043c09c848699f7d393edf7af03 Mon Sep 17 00:00:00 2001 From: George Koltsov Date: Fri, 19 Jul 2019 03:00:23 +0000 Subject: 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 --- lib/gitlab/import_export/project_tree_restorer.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/gitlab') 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 -- cgit v1.2.1