Commit c63db30f authored by Marc Schwede's avatar Marc Schwede

Changed confidential quick action to only be available on non confidential issues

parent 6dceb7bd
---
title: Changed confidential quick action to only be available on non confidential
issues
merge_request:
author: Marc Schwede
type: fixed
......@@ -135,7 +135,8 @@ module Gitlab
end
types Issue
condition do
current_user.can?(:"admin_#{quick_action_target.to_ability_name}", quick_action_target)
!quick_action_target.confidential? &&
current_user.can?(:"admin_#{quick_action_target.to_ability_name}", quick_action_target)
end
command :confidential do
@updates[:confidential] = true
......
......@@ -586,6 +586,22 @@ describe QuickActions::InterpretService do
expect(message).to eq('Made this issue confidential.')
end
context 'when issuable is already confidential' do
before do
issuable.update(confidential: true)
end
it 'does not return the success message' do
_, _, message = service.execute(content, issuable)
expect(message).to be_empty
end
it 'is not part of the available commands' do
expect(service.available_commands(issuable)).not_to include(a_hash_including(name: :confidential))
end
end
end
shared_examples 'shrug command' 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