aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2012-11-23 12:08:23 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2012-11-23 12:08:23 +0100
commit253eac504779ba48a73fac728645020811ce878c (patch)
tree686b9e6b7b14c9ce660ef6b885e78fb9931d717f
parenta82b5d0444d4db3ffc3f774cea7ff14ddc828dd7 (diff)
downloadsonarqube-253eac504779ba48a73fac728645020811ce878c.tar.gz
sonarqube-253eac504779ba48a73fac728645020811ce878c.zip
SONAR-3766 The "Roles" page should be displayed on Developer resource when a user is administrator of those resources
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb5
2 files changed, 5 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
index babcc925081..fc0d8b0041e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
@@ -44,6 +44,7 @@ import java.util.Map;
* <li>"modifiable_history": if set to "true", then the history of this resource may be modified (deletion of snapshots, modification of events, ...)</li>
* <li>"updatable_key" (since 3.2): if set to "true", then it is possible to update the key of this resource</li>
* <li>"supportsGlobalDashboards" (since 3.2): if true, this resource can be displayed in global dashboards</li>
+ * <li>"hasRolePolicy" : if true, roles configuration is available in sidebar</li>
* </ul>
*
* @since 2.14
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
index 45e0122883e..2967ca71cd8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
@@ -103,7 +103,10 @@
<li class="<%= 'selected' if request.request_uri.include?('/project/links') -%>">
<a href="<%= ApplicationController.root_context -%>/project/links/<%= @project.id -%>"><%= message('project_links.page') -%></a></li>
<% end %>
- <% if (@project.project? || @project.view? || @project.subview?) %>
+ <%
+ # NOTE: we keep "@project.view? || @project.subview?" in the test for backward compatibility with the Views plugin
+ if (controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'hasRolePolicy') || @project.view? || @project.subview?)
+ %>
<li class="<%= 'selected' if request.request_uri.include?('/project_roles') -%>">
<a href="<%= ApplicationController.root_context -%>/project_roles/index?resource=<%= @project.id -%>"><%= message('roles.page') -%></a></li>
<% end %>