Merge branch 'feature/service-desk-be-backport' into 'master'

Backport permissions and multi-line array to CE

See merge request !10507
This commit is contained in:
Sean McGivern 2017-04-07 11:18:40 +00:00
commit dca2aaaf6b
3 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
can! :access_api
can! :access_git
can! :receive_notifications
can! :use_slash_commands
end
end
end

View File

@ -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 = {}

View File

@ -5,7 +5,11 @@ require 'gitlab/email/handler/unsubscribe_handler'
module Gitlab
module Email
module Handler
HANDLERS = [UnsubscribeHandler, CreateNoteHandler, CreateIssueHandler].freeze
HANDLERS = [
UnsubscribeHandler,
CreateNoteHandler,
CreateIssueHandler
].freeze
def self.for(mail, mail_key)
HANDLERS.find do |klass|