Commit 7bb03a536a33b4e61f75b62e060c4b174b798f69
1 parent
c611ea51
Exists in
master
and in
4 other branches
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,9 +6,10 @@ | ||
6 | = @issue.created_at.stamp("Aug 21, 2011") | 6 | = @issue.created_at.stamp("Aug 21, 2011") |
7 | 7 | ||
8 | %span.pull-right | 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 | - if can?(current_user, :modify_issue, @issue) | 13 | - if can?(current_user, :modify_issue, @issue) |
13 | - if @issue.closed? | 14 | - if @issue.closed? |
14 | = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" | 15 | = link_to 'Reopen', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn grouped reopen_issue" |