Browse Source

SONAR-3932 problems with "Raw" link in Violations drilldown

=> For user without Code Viewer role
tags/3.5
Fabrice Bellingard 11 years ago
parent
commit
f75396cb17

+ 1
- 0
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties View File

@@ -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

+ 1
- 1
plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/ui/dependencies/DependenciesViewer.java View File

@@ -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() {

+ 11
- 3
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_tabs.html.erb View File

@@ -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 %>

Loading…
Cancel
Save