Commit 7bb03a536a33b4e61f75b62e060c4b174b798f69

Authored by Dmitriy Zaporozhets
1 parent c611ea51

Hide new issue button if not authorized

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
app/views/projects/issues/show.html.haml
... ... @@ -6,9 +6,10 @@
6 6 = @issue.created_at.stamp("Aug 21, 2011")
7 7  
8 8 %span.pull-right
9   - = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do
10   - %i.icon-plus
11   - New Issue
  9 + - if can?(current_user, :write_issue, @project)
  10 + = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do
  11 + %i.icon-plus
  12 + New Issue
12 13 - if can?(current_user, :modify_issue, @issue)
13 14 - if @issue.closed?
14 15 = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue"
... ...