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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5e9a7025
Commit
5e9a7025
authored
Mar 23, 2017
by
http://jneen.net/
Committed by
Felipe Artur
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to backport: add a global :use_slash_commands permission
parent
3efd4b09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
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
No files found.
app/policies/global_policy.rb
View file @
5e9a7025
...
...
@@ -10,6 +10,7 @@ class GlobalPolicy < BasePolicy
can!
:access_api
can!
:access_git
can!
:receive_notifications
can!
:use_slash_commands
end
end
end
app/services/slash_commands/interpret_service.rb
View file @
5e9a7025
...
...
@@ -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
=
{}
...
...
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