From: Simon Brandhof Date: Tue, 17 Jul 2012 20:07:49 +0000 (+0200) Subject: SONAR-3669 Filter widget crashes when end-user has not the role "user" X-Git-Tag: 3.2~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd34d391476d4d4276289032e36934333f53a88c;p=sonarqube.git SONAR-3669 Filter widget crashes when end-user has not the role "user" --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb index f99baebe77a..cfcb9f39d98 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb @@ -102,7 +102,7 @@ <% 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) %> <% if logged_in? %><%= link_to_favourite(root_snapshot.project) -%><% end %> @@ -127,7 +127,9 @@ <% end %> - <% end %> + <% end + end + %> <% if @filter_context.empty? %> <%= message('no_results') -%>