From cd34d391476d4d4276289032e36934333f53a88c Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 17 Jul 2012 22:07:49 +0200 Subject: [PATCH] SONAR-3669 Filter widget crashes when end-user has not the role "user" --- .../main/webapp/WEB-INF/app/views/filters/_list.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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') -%> -- 2.39.5