From 7bb03a536a33b4e61f75b62e060c4b174b798f69 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 25 Sep 2013 18:26:54 +0300 Subject: [PATCH] Hide new issue button if not authorized --- app/views/projects/issues/show.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index d36a83143..6d1a08872 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -6,9 +6,10 @@ = @issue.created_at.stamp("Aug 21, 2011") %span.pull-right - = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do - %i.icon-plus - New Issue + - if can?(current_user, :write_issue, @project) + = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do + %i.icon-plus + New Issue - if can?(current_user, :modify_issue, @issue) - if @issue.closed? = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" -- 2.11.0