Commit b2c2eba8 authored by George Koltsov's avatar George Koltsov

Add changelog entry

parent d91f381f
Pipeline #71201023 passed with stages
in 62 minutes and 59 seconds
---
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
......@@ -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`.
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment