X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/16a7c3c0b0bff303a6185282ab170fd495f7413d..28b6afc1e8ccf652c7a8fd43e22a8ac788febd85:/apps/workbench/app/controllers/users_controller.rb diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index febd6e3a1d..21ea7a8e69 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -39,6 +39,18 @@ class UsersController < ApplicationController def profile params[:offer_return_to] ||= params[:return_to] + + # In a federation situation, when you get a user record using + # "current user of token" it can fetch a stale user record from + # the local cluster. So even if profile settings were just written + # to the user record on the login cluster (because the user just + # filled out the profile), those profile settings may not appear + # in the "current user" response because it is returning a cached + # record from the local cluster. + # + # In this case, explicitly fetching user record forces it to get a + # fresh record from the login cluster. + Thread.current[:user] = User.find(current_user.uuid) end def activity @@ -124,7 +136,7 @@ class UsersController < ApplicationController def show_pane_list if current_user.andand.is_admin - super | %w(Admin) + %w(Admin) | super else super end