X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6c78b28f9f54664babc57a4b4372c502065ed5d1..09a3f207ceb2ddcdc7d31d0190eeed94962740d1:/apps/workbench/app/controllers/collections_controller.rb diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index 8d7e6ee332..2c8cf7e443 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -10,7 +10,7 @@ class CollectionsController < ApplicationController include ActionController::Live skip_around_action :require_thread_api_token, if: proc { |ctrl| - Rails.configuration.anonymous_user_token and + !Rails.configuration.Users.AnonymousUserToken.empty? and 'show' == ctrl.action_name } skip_around_action(:require_thread_api_token, @@ -124,7 +124,8 @@ class CollectionsController < ApplicationController # Otherwise, it's impossible to know whether any other request succeeded # because of the reader token. coll = nil - tokens = [(Rails.configuration.anonymous_user_token || nil), + tokens = [(if !Rails.configuration.Users.AnonymousUserToken.empty? then + Rails.configuration.Users.AnonymousUserToken else nil end), params[:reader_token], Thread.current[:arvados_api_token]].compact usable_token = find_usable_token(tokens) do @@ -138,7 +139,7 @@ class CollectionsController < ApplicationController opts = {} if usable_token == params[:reader_token] opts[:path_token] = usable_token - elsif usable_token == Rails.configuration.anonymous_user_token + elsif usable_token == Rails.configuration.Users.AnonymousUserToken # Don't pass a token at all else # We pass the current user's real token only if it's necessary