Commit 9d181d36 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Ignore pages permissions in template finder

We don't export anything related to GitLab Pages,
so we shouldn't care about these permissions.
parent 0f672aca
......@@ -20,7 +20,7 @@ class ProjectFeature < ApplicationRecord
container_registry
].freeze
EXPORTABLE_FEATURES = (FEATURES - [:security_and_compliance]).freeze
EXPORTABLE_FEATURES = (FEATURES - [:security_and_compliance, :pages]).freeze
set_available_features(FEATURES)
......
......@@ -16,7 +16,7 @@ Every project directly under the group namespace will be
available to the user if they have access to them. For example:
- Public projects, in the group will be available to every signed-in user, if all enabled [project features](../project/settings/index.md#sharing-and-permissions)
are set to **Everyone With Access**.
except for GitLab Pages are set to **Everyone With Access**.
- Private projects will be available only if the user is a member of the project.
Repository and database information that are copied over to each new project are
......
......@@ -62,7 +62,7 @@ GitLab administrators can
Within this section, you can configure the group where all the custom project
templates are sourced. Every project _template_ directly under the group namespace is
available to every signed-in user, if all enabled [project features](../project/settings/index.md#sharing-and-permissions) are set to **Everyone With Access**.
available to every signed-in user, if all enabled [project features](../project/settings/index.md#sharing-and-permissions) except for GitLab Pages are set to **Everyone With Access**.
However, private projects will be available only if the user is a member of the project.
......
......@@ -26,6 +26,12 @@ RSpec.describe CustomProjectTemplatesFinder do
expect(subject.execute).to be_empty
end
it 'ignores pages permissions as they are not exported' do
project = create(:project, :internal, :metrics_dashboard_enabled, namespace: group, pages_access_level: ProjectFeature::PRIVATE)
expect(subject.execute).to eq([project])
end
context 'when the group has projects' do
using RSpec::Parameterized::TableSyntax
......@@ -34,12 +40,12 @@ RSpec.describe CustomProjectTemplatesFinder do
let_it_be_with_reload(:public_project) { create :project, :metrics_dashboard_enabled, :public, namespace: group, name: 'public' }
where(:issues_access_level, :minimal_user_access, :available_templates) do
:disabled | :no_access | %w[public]
:disabled | :no_access | %w[public internal]
:disabled | :guest | %w[public internal private]
:private | :guest | %w[public internal private]
:private | :no_access | %w[]
:enabled | :guest | %w[public internal private]
:enabled | :no_access | %w[public]
:enabled | :no_access | %w[public internal]
end
with_them do
......
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