Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2019-08-26 15:23:36 +0300
committerYorick Peterse <yorick@yorickpeterse.com>2019-08-29 17:11:42 +0300
commite8dd299e7cb4fbb622359d762089367267ed5c09 (patch)
treed4448d16374f55de345e25ec2b2d098c231c319f /app
parente8bcabb4a735ecb84b5bc65269fffc21a72b6da6 (diff)
Improve chatops help output
This improves the output produced when running an unknown command, running the "help" command, and when trying to run a command you are not allowed to run. The new help output includes links to the project of the chatops integration, and a link to the chatops documentation.
Diffstat (limited to 'app')
-rw-r--r--app/models/project_services/slash_commands_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/project_services/slash_commands_service.rb b/app/models/project_services/slash_commands_service.rb
index cb16ad75d14..5bfd06476f0 100644
--- a/app/models/project_services/slash_commands_service.rb
+++ b/app/models/project_services/slash_commands_service.rb
@@ -35,7 +35,9 @@ class SlashCommandsService < Service
chat_user = find_chat_user(params)
if chat_user&.user
- return Gitlab::SlashCommands::Presenters::Access.new.access_denied unless chat_user.user.can?(:use_slash_commands)
+ unless chat_user.user.can?(:use_slash_commands)
+ return Gitlab::SlashCommands::Presenters::Access.new.access_denied(project)
+ end
Gitlab::SlashCommands::Command.new(project, chat_user, params).execute
else