summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-07-19 16:48:33 -0400
committerValery Sizov <vsv2711@gmail.com>2015-07-21 13:15:38 +0300
commit44f658012ddcf277c6a82fcde6faa7d92a8bea7a (patch)
treedad1f22f63edf92d4fe2c29342b53c6616553a22
parent3387c4bde850f2361bbd416c9364a52024bd36a8 (diff)
downloadgitlab-ce-44f658012ddcf277c6a82fcde6faa7d92a8bea7a.tar.gz
Dynamically check `:admin_*` ability in issuable context
Closes #2001
-rw-r--r--app/views/shared/issuable/_context.html.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/shared/issuable/_context.html.haml b/app/views/shared/issuable/_context.html.haml
index 46990895d33..d1bd5ef968d 100644
--- a/app/views/shared/issuable/_context.html.haml
+++ b/app/views/shared/issuable/_context.html.haml
@@ -8,7 +8,7 @@
- else
none
.issuable-context-selectbox
- - if can?(current_user, :admin_issue, @project)
+ - if can?(current_user, :"admin_#{issuable.class.to_s.underscore}", @project)
= users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true)
%div.prepend-top-20.clearfix
@@ -24,7 +24,7 @@
- else
none
.issuable-context-selectbox
- - if can?(current_user, :admin_issue, @project)
+ - if can?(current_user, :"admin_#{issuable.class.to_s.underscore}", @project)
= f.select(:milestone_id, milestone_options(issuable), { include_blank: 'Select milestone' }, {class: 'select2 select2-compact js-select2 js-milestone'})
= hidden_field_tag :issuable_context
= f.submit class: 'btn hide'