diff options
author | Hordur Freyr Yngvason <hfyngvason@gitlab.com> | 2019-07-04 13:31:44 +0300 |
---|---|---|
committer | Hordur Freyr Yngvason <hfyngvason@gitlab.com> | 2019-07-19 12:32:06 +0300 |
commit | 7b52cff4896c8f681aea34fb273209400cf3e06e (patch) | |
tree | 6e670b3da63422b09a40aaeaab56a6df3facd771 /app/models | |
parent | 627d2b7fa440f4f9c6fd83f0cef8ab4ed705e9a5 (diff) |
Restrict slash commands to users who can log in
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project_services/slash_commands_service.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project_services/slash_commands_service.rb b/app/models/project_services/slash_commands_service.rb index 5f5cff97808..cb16ad75d14 100644 --- a/app/models/project_services/slash_commands_service.rb +++ b/app/models/project_services/slash_commands_service.rb @@ -35,6 +35,8 @@ 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) + Gitlab::SlashCommands::Command.new(project, chat_user, params).execute else url = authorize_chat_name_url(params) |