From 253eac504779ba48a73fac728645020811ce878c Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 23 Nov 2012 12:08:23 +0100 Subject: [PATCH] SONAR-3766 The "Roles" page should be displayed on Developer resource when a user is administrator of those resources --- .../src/main/java/org/sonar/api/resources/ResourceType.java | 1 + .../main/webapp/WEB-INF/app/views/layouts/_layout.html.erb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 %> -- 2.39.5