Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
60c121eb
Commit
60c121eb
authored
Apr 06, 2017
by
Felipe Artur
Committed by
Sean McGivern
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport permissions and multi-line array to CE
parent
0a4b853f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
app/policies/global_policy.rb
app/policies/global_policy.rb
+1
-0
app/services/slash_commands/interpret_service.rb
app/services/slash_commands/interpret_service.rb
+2
-0
lib/gitlab/email/handler.rb
lib/gitlab/email/handler.rb
+5
-1
No files found.
app/policies/global_policy.rb
View file @
60c121eb
...
@@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
...
@@ -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
app/services/slash_commands/interpret_service.rb
View file @
60c121eb
...
@@ -7,6 +7,8 @@ module SlashCommands
...
@@ -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
=
{}
...
...
lib/gitlab/email/handler.rb
View file @
60c121eb
...
@@ -5,7 +5,11 @@ require 'gitlab/email/handler/unsubscribe_handler'
...
@@ -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
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment