Skip to content
Snippets Groups Projects
Commit 60c121eb authored by Felipe Artur's avatar Felipe Artur Committed by Sean McGivern
Browse files

Backport permissions and multi-line array to CE

parent 0a4b853f
No related branches found
No related tags found
1 merge request!10507Backport permissions and multi-line array to CE
Pipeline #
Loading
@@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
Loading
@@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
can! :access_api can! :access_api
can! :access_git can! :access_git
can! :receive_notifications can! :receive_notifications
can! :use_slash_commands
end end
end end
end end
Loading
@@ -7,6 +7,8 @@ module SlashCommands
Loading
@@ -7,6 +7,8 @@ module SlashCommands
# Takes a text and interprets the commands that are extracted from it. # 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. # Returns the content without commands, and hash of changes to be applied to a record.
def execute(content, issuable) def execute(content, issuable)
return [content, {}] unless current_user.can?(:use_slash_commands)
@issuable = issuable @issuable = issuable
@updates = {} @updates = {}
   
Loading
Loading
Loading
@@ -5,7 +5,11 @@ require 'gitlab/email/handler/unsubscribe_handler'
Loading
@@ -5,7 +5,11 @@ require 'gitlab/email/handler/unsubscribe_handler'
module Gitlab module Gitlab
module Email module Email
module Handler module Handler
HANDLERS = [UnsubscribeHandler, CreateNoteHandler, CreateIssueHandler].freeze HANDLERS = [
UnsubscribeHandler,
CreateNoteHandler,
CreateIssueHandler
].freeze
   
def self.for(mail, mail_key) def self.for(mail, mail_key)
HANDLERS.find do |klass| HANDLERS.find do |klass|
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment