]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3766 The "Roles" page should be displayed on Developer resource when a user...
authorJulien Lancelot <julien.lancelot@gmail.com>
Fri, 23 Nov 2012 11:08:23 +0000 (12:08 +0100)
committerJulien Lancelot <julien.lancelot@gmail.com>
Fri, 23 Nov 2012 11:08:23 +0000 (12:08 +0100)
sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb

index babcc92508102665d6a72c1175a84f79db4c0247..fc0d8b0041ede12375cc6dbc4ff81679b13d4c9a 100644 (file)
@@ -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
index 45e0122883e9206d1800dd45f93d40299dc5d393..2967ca71cd89ac62227cb9dcaa500e925fa2eaad 100644 (file)
               <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 %>