]> source.dussan.org Git - sonarqube.git/commitdiff
Authentication check should not be done when using Java WS on batch/index action
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 22 Apr 2014 14:40:16 +0000 (16:40 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 22 Apr 2014 14:40:16 +0000 (16:40 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/java_ws_controller.rb

index cb6e1c5047d070a6010072a435d7c53bf55a22bb..b547f08dacf464f4c03d85894c1d91ff1599ce2c 100644 (file)
@@ -21,7 +21,7 @@
 # since 4.2
 class Api::JavaWsController < Api::ApiController
 
-  skip_before_filter :check_authentication
+  skip_before_filter :check_authentication, :except => 'skip_authentication_check_for_batch_index'
 
   def index
     ws_request = Java::OrgSonarServerWs::ServletRequest.new(servlet_request, params.to_java)
@@ -38,4 +38,11 @@ class Api::JavaWsController < Api::ApiController
   def redirect_to_ws_listing
     redirect_to :action => 'index', :wspath => 'api/webservices', :wsaction => 'list'
   end
+
+  private
+
+  def skip_authentication_check_for_batch_index
+    params[:wspath]=='batch' && params[:wsaction]=='index'
+  end
+
 end