From: Julien Lancelot Date: Fri, 23 Nov 2012 11:08:23 +0000 (+0100) Subject: SONAR-3766 The "Roles" page should be displayed on Developer resource when a user... X-Git-Tag: 3.4~292 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=253eac504779ba48a73fac728645020811ce878c;p=sonarqube.git SONAR-3766 The "Roles" page should be displayed on Developer resource when a user is administrator of those resources --- 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; *
  • "modifiable_history": if set to "true", then the history of this resource may be modified (deletion of snapshots, modification of events, ...)
  • *
  • "updatable_key" (since 3.2): if set to "true", then it is possible to update the key of this resource
  • *
  • "supportsGlobalDashboards" (since 3.2): if true, this resource can be displayed in global dashboards
  • + *
  • "hasRolePolicy" : if true, roles configuration is available in sidebar
  • * * * @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 @@
  • <%= message('project_links.page') -%>
  • <% 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?) + %>
  • <%= message('roles.page') -%>
  • <% end %>