Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gpt
large_projects
gitlabhq1
Commits
1cc914f2
Commit
1cc914f2
authored
9 years ago
by
Rubén Dávila
Browse files
Options
Download
Email Patches
Plain Diff
Show Edit link on sidebar only if current user can update the Issue/MR
parent
a697b015
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
CHANGELOG
CHANGELOG
+1
-0
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+6
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+3
-3
No files found.
CHANGELOG
View file @
1cc914f2
...
...
@@ -12,6 +12,7 @@ v 8.6.0 (unreleased)
- Allow search for logged out users
- Don't show Issues/MRs from archived projects in Groups view
- Increase the notes polling timeout over time (Roberto Dip)
- Fix: Show Edit link on sidebar only if current user can update the Issue/MR
v 8.5.4
- Do not cache requests for badges (including builds badge)
...
...
This diff is collapsed.
Click to expand it.
app/helpers/issuables_helper.rb
View file @
1cc914f2
...
...
@@ -20,6 +20,12 @@ module IssuablesHelper
base_issuable_scope
(
issuable
).
where
(
'iid < ?'
,
issuable
.
iid
).
first
end
def
can_update_issuable?
(
issuable
)
return
false
unless
current_user
can?
(
current_user
,
:"update_
#{
issuable
.
to_ability_name
}
"
,
issuable
)
end
private
def
sidebar_gutter_collapsed?
...
...
This diff is collapsed.
Click to expand it.
app/views/shared/issuable/_sidebar.html.haml
View file @
1cc914f2
...
...
@@ -30,7 +30,7 @@
.title.hide-collapsed
%label
Assignee
-
if
can
?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
-
if
can
_update_issuable?
(
issuable
)
.pull-right
=
link_to
'Edit'
,
'#'
,
class:
'edit-link'
.value.hide-collapsed
...
...
@@ -56,7 +56,7 @@
.title.hide-collapsed
%label
Milestone
-
if
can
?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
-
if
can
_update_issuable?
(
issuable
)
.pull-right
=
link_to
'Edit'
,
'#'
,
class:
'edit-link'
.value.hide-collapsed
...
...
@@ -81,7 +81,7 @@
=
issuable
.
labels
.
count
.title.hide-collapsed
%label
Labels
-
if
can
?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
-
if
can
_update_issuable?
(
issuable
)
.pull-right
=
link_to
'Edit'
,
'#'
,
class:
'edit-link'
.value.issuable-show-labels.hide-collapsed
...
...
This diff is collapsed.
Click to expand it.
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