summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Koltsov <gkoltsov@gitlab.com>2019-07-09 16:23:22 +0100
committerGeorge Koltsov <gkoltsov@gitlab.com>2019-07-10 11:56:46 +0100
commit39188909069ba986b37da8ad2a7db10946287d8e (patch)
treeafb4bcb392519106df47ae264a1de7b76306455e
parent0cd59a756cdee7aac8915f3e96ba4f065e5cbc9c (diff)
downloadgitlab-ce-39188909069ba986b37da8ad2a7db10946287d8e.tar.gz
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
-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 20caadb89c0..1bd9f6c3f59 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -129,6 +129,7 @@ module Gitlab
def visibility_level
level = override_params['visibility_level'] || json_params['visibility_level'] || @project.visibility_level
+ level = Gitlab::VisibilityLevel::PRIVATE if level == Gitlab::VisibilityLevel::INTERNAL && Gitlab::CurrentSettings.restricted_visibility_levels.include?(level)
level = @project.group.visibility_level if @project.group && level.to_i > @project.group.visibility_level
{ 'visibility_level' => level }