diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-08-26 15:23:36 +0300 |
---|---|---|
committer | Yorick Peterse <yorick@yorickpeterse.com> | 2019-08-29 17:11:42 +0300 |
commit | e8dd299e7cb4fbb622359d762089367267ed5c09 (patch) | |
tree | d4448d16374f55de345e25ec2b2d098c231c319f /app | |
parent | e8bcabb4a735ecb84b5bc65269fffc21a72b6da6 (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.rb | 4 |
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 |