Commit 34caa5dd authored by Alexandru Croitor's avatar Alexandru Croitor

Restrict hierarchy related epic quick actions in mysql

We do not support epic hierarchy in mysql so
/child_epic and /remove_child_epic quick actions should not be
available in MySQL.

https://gitlab.com/gitlab-org/gitlab-ee/issues/11703
parent 4bcd7bad
---
title: Restrict child_epic and remove_child_epic quick actions when using mysql
merge_request: 13152
author:
type: fixed
......@@ -51,7 +51,7 @@ module EE
end
def action_allowed?
quick_action_target.group&.feature_available?(:epics) &&
::Epic.supports_nested_objects? && quick_action_target.group&.feature_available?(:epics) &&
current_user.can?(:"admin_#{quick_action_target.to_ability_name}", quick_action_target)
end
end
......
......@@ -101,10 +101,10 @@ describe Groups::AutocompleteService do
end
it 'returns available commands' do
expect(subject.commands(epic).map { |c| c[:name] })
.to match_array(
[:todo, :unsubscribe, :award, :shrug, :tableflip, :cc, :title, :close, :child_epic, :remove_child_epic]
)
available_commands = [:todo, :unsubscribe, :award, :shrug, :tableflip, :cc, :title, :close]
available_commands += [:child_epic, :remove_child_epic] if ::Epic.supports_nested_objects?
expect(subject.commands(epic).map { |c| c[:name] }).to match_array(available_commands)
end
end
end
......
......@@ -807,7 +807,7 @@ describe QuickActions::InterpretService do
group.add_developer(current_user)
end
context 'child_epic command' do
context 'child_epic command', :nested_groups do
context 'when correct epic reference' do
let(:content) { "/child_epic #{child_epic&.to_reference(epic)}" }
......@@ -827,7 +827,7 @@ describe QuickActions::InterpretService do
end
end
context 'remove_child_epic command' do
context 'remove_child_epic command', :nested_groups do
context 'when correct epic reference' do
let(:content) { "/remove_child_epic #{child_epic&.to_reference(epic)}" }
......
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