summaryrefslogtreecommitdiff
path: root/app/services/quick_actions
diff options
context:
space:
mode:
authorJan <king-jan1999@hotmail.de>2018-06-13 12:42:36 +0000
committerRémy Coutable <remy@rymai.me>2018-06-13 12:42:36 +0000
commit5ba9279c5039615fd797beab273f3c1aeb642dd0 (patch)
tree7a8ccb1e15d496c981331b64f6e5165a04bb8ab8 /app/services/quick_actions
parent031ee142b1cd941eb10afd11db553173a60428f3 (diff)
downloadgitlab-ce-5ba9279c5039615fd797beab273f3c1aeb642dd0.tar.gz
Resolve "Add `/confidential` quick action for issues"
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r--app/services/quick_actions/interpret_service.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index 0215994b1a7..9ac8fdb4cff 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -561,6 +561,17 @@ module QuickActions
end
end
+ desc 'Make issue confidential.'
+ explanation do
+ 'Makes this issue confidential'
+ end
+ condition do
+ issuable.is_a?(Issue) && current_user.can?(:"admin_#{issuable.to_ability_name}", issuable)
+ end
+ command :confidential do
+ @updates[:confidential] = true
+ end
+
def extract_users(params)
return [] if params.nil?