Commit 6cd34d80 authored by George Koltsov's avatar George Koltsov

Allow developer role to access group-level templates

Previously only maintainer and above roles were able to
create projects using group level templates.
As per our documentation, group level templates should be
accessible to any roles that has access to create new projects.
Lowering the bar to allow developer role to create projects
using group-level templates.
parent 22c25d2d
...@@ -181,7 +181,7 @@ module EE ...@@ -181,7 +181,7 @@ module EE
def available_subgroups_with_custom_project_templates(group_id = nil) def available_subgroups_with_custom_project_templates(group_id = nil)
groups = GroupsWithTemplatesFinder.new(group_id).execute groups = GroupsWithTemplatesFinder.new(group_id).execute
GroupsFinder.new(self, min_access_level: ::Gitlab::Access::MAINTAINER) GroupsFinder.new(self, min_access_level: ::Gitlab::Access::DEVELOPER)
.execute .execute
.where(id: groups.select(:custom_project_templates_group_id)) .where(id: groups.select(:custom_project_templates_group_id))
.includes(:projects) .includes(:projects)
......
...@@ -364,7 +364,7 @@ describe User do ...@@ -364,7 +364,7 @@ describe User do
context 'when the access level of the user is below the required one' do context 'when the access level of the user is below the required one' do
before do before do
group_1.add_developer(user) group_1.add_reporter(user)
end end
it 'returns an empty collection' do it 'returns an empty collection' do
...@@ -374,9 +374,9 @@ describe User do ...@@ -374,9 +374,9 @@ describe User do
context 'when the access level of the user is the correct' do context 'when the access level of the user is the correct' do
before do before do
group_1.add_maintainer(user) group_1.add_developer(user)
group_2.add_maintainer(user) group_2.add_maintainer(user)
group_3.add_maintainer(user) group_3.add_developer(user)
end end
context 'when a Group ID is passed' do context 'when a Group ID is passed' 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