=> For user without Code Viewer roletags/3.5
@@ -1075,6 +1075,7 @@ coverage_viewer.overall_tests=All Tests | |||
# GENERIC CODE VIEWER | |||
# | |||
#------------------------------------------------------------------------------ | |||
code_viewer.no_info_displayed_due_to_security=Due to security settings, no information can be displayed. | |||
code_viewer.create_violation.new_rule=New Rule | |||
code_viewer.create_violation.rules=Rules | |||
code_viewer.create_violation.submit=Create Violation |
@@ -33,7 +33,7 @@ import org.sonar.api.web.UserRole; | |||
@ResourceQualifier({Qualifiers.FILE, Qualifiers.CLASS, Qualifiers.PACKAGE, Qualifiers.PROJECT, Qualifiers.MODULE}) | |||
@DefaultTab(metrics = {CoreMetrics.AFFERENT_COUPLINGS_KEY, CoreMetrics.EFFERENT_COUPLINGS_KEY}) | |||
@NavigationSection({NavigationSection.RESOURCE_TAB}) | |||
@UserRole(UserRole.USER) | |||
@UserRole(UserRole.CODEVIEWER) | |||
public class DependenciesViewer extends AbstractRubyTemplate implements RubyRailsPage { | |||
public String getId() { |
@@ -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 -%>&format=txt"><%= message('raw') -%></a> | |||
@@ -56,3 +62,5 @@ | |||
</li> | |||
</ul> | |||
</div> | |||
<% end %> |