summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-07 11:18:40 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-07 11:18:40 +0000
commitdca2aaaf6ba03f6491b04e7df912f2f1bc156fb1 (patch)
tree24a15e4586f13aa727aa5f3cb7b7e8b9cfe95443 /app
parent333a4c8cf523ff0098d84b070ffbaf1828646b7b (diff)
parent60c121ebc202e0de31a5a6212346128341d2766b (diff)
downloadgitlab-ce-dca2aaaf6ba03f6491b04e7df912f2f1bc156fb1.tar.gz
Merge branch 'feature/service-desk-be-backport' into 'master'
Backport permissions and multi-line array to CE See merge request !10507
Diffstat (limited to 'app')
-rw-r--r--app/policies/global_policy.rb1
-rw-r--r--app/services/slash_commands/interpret_service.rb2
2 files changed, 3 insertions, 0 deletions
diff --git a/app/policies/global_policy.rb b/app/policies/global_policy.rb
index cb72c2b4590..4757ba71680 100644
--- a/app/policies/global_policy.rb
+++ b/app/policies/global_policy.rb
@@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
can! :access_api
can! :access_git
can! :receive_notifications
+ can! :use_slash_commands
end
end
end
diff --git a/app/services/slash_commands/interpret_service.rb b/app/services/slash_commands/interpret_service.rb
index 595653ea58a..49d45ec9dbd 100644
--- a/app/services/slash_commands/interpret_service.rb
+++ b/app/services/slash_commands/interpret_service.rb
@@ -7,6 +7,8 @@ module SlashCommands
# Takes a text and interprets the commands that are extracted from it.
# Returns the content without commands, and hash of changes to be applied to a record.
def execute(content, issuable)
+ return [content, {}] unless current_user.can?(:use_slash_commands)
+
@issuable = issuable
@updates = {}