gitlab-org--gitlab-foss/lib/gitlab/chat_commands/presenters/access.rb
Z.J. van de Weg dc6921bdbb Chat Commands have presenters
This improves the styling and readability of the code. This is supported
by both Mattermost and Slack.
2017-01-30 09:24:05 +01:00

22 lines
708 B
Ruby

module Gitlab::ChatCommands::Presenters
class Access < Gitlab::ChatCommands::Presenters::Base
def access_denied
ephemeral_response(text: "Whoops! This action is not allowed. This incident will be [reported](https://xkcd.com/838/).")
end
def not_found
ephemeral_response(text: "404 not found! GitLab couldn't find what you were looking for! :boom:")
end
def authorize
message =
if @resource
":wave: Hi there! Before I do anything for you, please [connect your GitLab account](#{@resource})."
else
":sweat_smile: Couldn't identify you, nor can I autorize you!"
end
ephemeral_response(text: message)
end
end
end