summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Koltsov <gkoltsov@gitlab.com>2019-07-10 10:54:03 +0100
committerGeorge Koltsov <gkoltsov@gitlab.com>2019-07-16 09:22:55 +0100
commitb2c2eba89e2a5a293bd6e06bb17f17b6178e599d (patch)
treed74fc3f04973884f2c094e111838bbd352f080d7
parentd91f381fdc4239b6f669ffd76c21aa3b1197262d (diff)
downloadgitlab-ce-b2c2eba89e2a5a293bd6e06bb17f17b6178e599d.tar.gz
Add changelog entry
-rw-r--r--changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml5
-rw-r--r--doc/user/project/settings/import_export.md7
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb14
3 files changed, 22 insertions, 4 deletions
diff --git a/changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml b/changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml
new file mode 100644
index 00000000000..18af16e5216
--- /dev/null
+++ b/changelogs/unreleased/georgekoltsov-64311-set-visibility-private-if-internal-restricted.yml
@@ -0,0 +1,5 @@
+---
+title: Set visibility level 'Private' for restricted 'Internal' imported projects when 'Internal' visibility setting is restricted in admin settings
+merge_request: 30522
+author:
+type: other
diff --git a/doc/user/project/settings/import_export.md b/doc/user/project/settings/import_export.md
index 98bcc7cc09f..9b12f7230b7 100644
--- a/doc/user/project/settings/import_export.md
+++ b/doc/user/project/settings/import_export.md
@@ -116,3 +116,10 @@ For more details on the specific data persisted in a project export, see the
1. Click on **Import project** to begin importing. Your newly imported project
page will appear soon.
+
+NOTE: **Note:**
+If use of the `Internal` visibility level
+[is restricted](../../../public_access/public_access.md#restricting-the-use-of-public-or-internal-projects),
+all imported projects with a visibility of `Internal` are given the
+visibility of `Private`, unless they are imported to a group with a
+visibility of `Internal`.
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index 1d6c8b7e50e..da180988252 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -492,14 +492,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
context 'with restricted internal visibility' do
- before do
- Gitlab::CurrentSettings.restricted_visibility_levels = [visibility]
- end
-
describe 'internal project' do
let(:visibility) { Gitlab::VisibilityLevel::INTERNAL }
it 'uses private visibility' do
+ stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::INTERNAL])
+
expect(restorer.restored_project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
end
end
@@ -537,6 +535,14 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it 'uses the group visibility' do
expect(restorer.restored_project.visibility_level).to eq(group_visibility)
end
+
+ context 'with restricted internal visibility' do
+ it 'uses the group visibility' do
+ stub_application_setting(restricted_visibility_levels: [Gitlab::VisibilityLevel::INTERNAL])
+
+ expect(restorer.restored_project.visibility_level).to eq(group_visibility)
+ end
+ end
end
end
end