summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-01-11 15:22:00 +0100
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2013-01-11 15:22:32 +0100
commitf75396cb1754322c72e66bc4e588b88af4d9ea71 (patch)
tree876177369c753895d12e3932dd52c54a9360a1f8 /sonar-server
parentb3ac1f07b44394fe08f467ac104ea1e797d2e4f3 (diff)
downloadsonarqube-f75396cb1754322c72e66bc4e588b88af4d9ea71.tar.gz
sonarqube-f75396cb1754322c72e66bc4e588b88af4d9ea71.zip
SONAR-3932 problems with "Raw" link in Violations drilldown
=> For user without Code Viewer role
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb14
1 files changed, 11 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
index 1f889f74354..f6990640dc1 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb
@@ -1,7 +1,13 @@
<%
- display_title=(params[:display_title]=='true')
- if display_title
+ if @extensions.empty?
%>
+ <span class="note"><%= message('code_viewer.no_info_displayed_due_to_security') -%></span>
+<%
+ else
+ display_title=(params[:display_title]=='true')
+%>
+
+<% if display_title %>
<div id="source_title">
<%
selected_project_id = params[:project].to_i
@@ -19,7 +25,7 @@
<ul class="tablinks">
<%
first=true
- if @snapshot.source
+ if @snapshot.source && has_role?(:codeviewer, @snapshot)
%>
<li class="<%= 'first' if first -%>">
<a href="<%= ApplicationController.root_context -%>/api/sources?resource=<%= @resource.key -%>&amp;format=txt"><%= message('raw') -%></a>
@@ -56,3 +62,5 @@
</li>
</ul>
</div>
+
+<% end %>