aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-04-03 16:21:09 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-04-03 16:21:09 +0200
commit7db109863216c4b1b85a0d90202b033a5e4cbc09 (patch)
treebb6b09a46d950b8372717ed09ce4ec1dc4d69e8f
parentedeeec77281299b6b3e4928c2e221e2a15b8cc44 (diff)
downloadsonarqube-7db109863216c4b1b85a0d90202b033a5e4cbc09.tar.gz
sonarqube-7db109863216c4b1b85a0d90202b033a5e4cbc09.zip
Fix backward-compatibility of views plugin and management console of roles
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
index c5fe2b39846..a4831834b37 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb
@@ -31,12 +31,13 @@ class RolesController < ApplicationController
def projects
# for backward-compatibility with versions of views plugin that do not depend on sonar 2.15
- @qualifiers = (['VW', 'SVW'] + java_facade.getQualifiersWithProperty('hasRolePolicy').to_a).compact.uniq
+ if java_facade.hasPlugin('views')
+ @qualifiers = (['VW', 'SVW'] + java_facade.getQualifiersWithProperty('hasRolePolicy').to_a).compact.uniq
+ else
+ @qualifiers = java_facade.getQualifiersWithProperty('hasRolePolicy')
+ end
@qualifier = params[:qualifier] || 'TRK'
- # it's not possible to paginate directly in database because
- # sort would be case-sensitive
-
conditions_sql = 'projects.enabled=:enabled and projects.qualifier=:qualifier and projects.copy_resource_id is null'
conditions_values = {:enabled => true, :qualifier => @qualifier}