Commit ee1343b5 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'georgekoltsov/12806-update-custom-group-level-templates' into 'master'

Allow developer role to access group-level templates

See merge request gitlab-org/gitlab-ee!15364
parents fcf75b93 32895aaa
...@@ -195,7 +195,7 @@ module EE ...@@ -195,7 +195,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)
......
---
title: Allow developer role to access group-level templates when creating a new project
merge_request: 15364
author:
type: fixed
...@@ -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