Refactor to show the Issues link based on the calculated permissions
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Oct 2018 14:42:01 +0000 (16:42 +0200)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Oct 2018 14:42:01 +0000 (16:42 +0200)
app/views/layouts/_header.html.erb

index e17c6a7..946f95f 100644 (file)
@@ -54,7 +54,7 @@
       <li id="compact-secondary-nav" class="dropdown">
         <a class="dropdown-toggle" data-toggle="dropdown" href="#"><%= t 'layouts.more' %> <b class="caret"></b></a>
         <ul class="dropdown-menu">
       <li id="compact-secondary-nav" class="dropdown">
         <a class="dropdown-toggle" data-toggle="dropdown" href="#"><%= t 'layouts.more' %> <b class="caret"></b></a>
         <ul class="dropdown-menu">
-          <% if current_user and ( current_user.administrator? or current_user.moderator? ) %>
+          <% if can? :index, Issue %>
             <li class="<%= current_page_class(issues_path) %>">
               <%= link_to issues_path(:status => 'open') do %>
                 <%= open_issues_count %>
             <li class="<%= current_page_class(issues_path) %>">
               <%= link_to issues_path(:status => 'open') do %>
                 <%= open_issues_count %>