]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3669 Filter widget crashes when end-user has not the role "user"
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 17 Jul 2012 20:07:49 +0000 (22:07 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 17 Jul 2012 20:08:21 +0000 (22:08 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb

index f99baebe77ae0df1277f222b9c336262e35a6d00..cfcb9f39d9843e9acccd6f531ca72be58f4a06ce 100644 (file)
   <% 
      if @filter_context.filter.display_path_data?
        root_snapshot = Snapshot.find(:first, :include => 'project', :conditions => ['projects.id=? and islast=?', @filter_context.filter.resource_id, true])
-       root_snapshot=nil if root_snapshot && !(has_role?(:user, root_snapshot))
+       if root_snapshot && has_role?(:user, root_snapshot)
   %>
     <tr class="highlight">
       <td><% if logged_in? %><%= link_to_favourite(root_snapshot.project) -%><% end %></td>
       </td>
       <% end %>
     </tr>
-  <% end %>
+  <% end
+  end
+  %>
 
   <% if @filter_context.empty? %>
     <tr class="even"><td colspan="<%= 1+filter.columns.size -%>"><%= message('no_results') -%></td></tr>