aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-06-09 15:33:43 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-06-10 22:03:49 +0200
commit38c6a803fb039c12565b3a51a2cbfbaf80958507 (patch)
tree0a4b45663aeae5800de70fbae55d59de4144c503 /server/sonar-web/src/main/webapp/WEB-INF
parent68c69c9e716ff2de59207b691754488c7e9b42b9 (diff)
downloadsonarqube-38c6a803fb039c12565b3a51a2cbfbaf80958507.tar.gz
sonarqube-38c6a803fb039c12565b3a51a2cbfbaf80958507.zip
Remove support of unused property sonar.authorizer in ruby code
Diffstat (limited to 'server/sonar-web/src/main/webapp/WEB-INF')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/all_pass_authorizer.rb33
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/logged_in_authorizer.rb35
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb (renamed from server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/default_authorizer.rb)2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb14
4 files changed, 4 insertions, 80 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/all_pass_authorizer.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/all_pass_authorizer.rb
deleted file mode 100644
index fe7c9b8e516..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/all_pass_authorizer.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-class SonarAuthorizer
- def has_role?(user, role)
- true
- end
-
- def has_role_for_resources?(user, role, resource_ids)
- resource_ids.map{|rid| true}
- end
-
- def on_logout(user)
-
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/logged_in_authorizer.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/logged_in_authorizer.rb
deleted file mode 100644
index ce7d0b7b831..00000000000
--- a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/logged_in_authorizer.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# SonarQube, open source software quality management tool.
-# Copyright (C) 2008-2014 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# SonarQube is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# SonarQube is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-
-class SonarAuthorizer
-
- def has_role?(user, role)
- !user.id.nil?
- end
-
- def has_role_for_resources?(user, role, resource_ids)
- authorized=has_role?(user, role)
- resource_ids.map{|rid| authorized}
- end
-
- def on_logout(user)
-
- end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/default_authorizer.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb
index 2b1de852d15..6a2330139dd 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/lib/authorization/default_authorizer.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/lib/default_authorizer.rb
@@ -19,7 +19,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-class SonarAuthorizer
+class DefaultAuthorizer
def has_role?(user, role)
global_roles(user).include?(role)
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb b/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb
index 118a48e4029..08d1a327b71 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/lib/need_authorization.rb
@@ -18,21 +18,13 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-#
-# This class loads your own authorization service from the configuration
-# in the <code>sonar.properties</code> file.
-# The property is <code>sonar.authorizer=[Your service file name]</code>.
-# Before that you should put your service file into the lib/authorization directory.
-# The service class must be named SonarAuthorizer.
-#
class AuthorizerFactory
@@authorizer = nil
def self.authorizer
if (@@authorizer.nil?)
- filename = Java::OrgSonarServerUi::JRubyFacade.new.getConfigurationValue('sonar.authorizer') || 'default_authorizer'
- require File.dirname(__FILE__) + "/authorization/#{filename}"
- @@authorizer ||= SonarAuthorizer.new
+ require File.dirname(__FILE__) + "/default_authorizer"
+ @@authorizer ||= DefaultAuthorizer.new
end
@@authorizer
end
@@ -40,7 +32,7 @@ class AuthorizerFactory
end
# NeedAuthorization is a set of modules that enhance your models and controller classes in authorization function.
-# All the methods in this module will finally delegate to the loaded SonarAuthorizer.
+# All the methods in this module will finally delegate to the loaded DefaultAuthorizer.
module NeedAuthorization
# ForUser module is used for the User class, to decide if the user has certain "global" permissions.