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
7c831be0
Commit
7c831be0
authored
Feb 20, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated permission check
Changed how it checks if issuable has weight
parent
db7ee8ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/services/slash_commands/interpret_service.rb
app/services/slash_commands/interpret_service.rb
+5
-5
No files found.
app/services/slash_commands/interpret_service.rb
View file @
7c831be0
...
@@ -317,10 +317,10 @@ module SlashCommands
...
@@ -317,10 +317,10 @@ module SlashCommands
end
end
desc
'Set weight'
desc
'Set weight'
params
'1-9'
params
Issue
::
WEIGHT_RANGE
.
to_s
.
squeeze
(
'.'
).
tr
(
'.'
,
'-'
)
condition
do
condition
do
issuable
.
is_a?
(
Issue
)
&&
issuable
.
respond_to?
(
:weight
)
&&
current_user
.
can?
(
:"
update
_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
current_user
.
can?
(
:"
admin
_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
end
end
command
:weight
do
|
weight
|
command
:weight
do
|
weight
|
if
Issue
.
weight_filter_options
.
include?
(
weight
.
to_i
)
if
Issue
.
weight_filter_options
.
include?
(
weight
.
to_i
)
...
@@ -331,9 +331,9 @@ module SlashCommands
...
@@ -331,9 +331,9 @@ module SlashCommands
desc
'Clear weight'
desc
'Clear weight'
condition
do
condition
do
issuable
.
persisted?
&&
issuable
.
persisted?
&&
issuable
.
is_a?
(
Issue
)
&&
issuable
.
respond_to?
(
:weight
)
&&
issuable
.
weight?
&&
issuable
.
weight?
&&
current_user
.
can?
(
:"
update
_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
current_user
.
can?
(
:"
admin
_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
end
end
command
:clear_weight
do
command
:clear_weight
do
@updates
[
:weight
]
=
nil
@updates
[
:weight
]
=
nil
...
...
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