##// END OF EJS Templates
introduce request_store to ensure that the current user doesn't leak across request boundaries (#16685)...
Toshi MARUYAMA -
r12835:a599442d05e5
parent child
Show More
@@ -6,6 +6,7 gem "jquery-rails", "~> 2.0.2"
6 gem "coderay", "~> 1.1.0"
6 gem "coderay", "~> 1.1.0"
7 gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
7 gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
8 gem "builder", "3.0.0"
8 gem "builder", "3.0.0"
9 gem 'request_store'
9 gem "mime-types"
10 gem "mime-types"
10
11
11 # Optional gem for LDAP authentication
12 # Optional gem for LDAP authentication
@@ -626,11 +626,11 class User < Principal
626 end
626 end
627
627
628 def self.current=(user)
628 def self.current=(user)
629 Thread.current[:current_user] = user
629 RequestStore.store[:current_user] = user
630 end
630 end
631
631
632 def self.current
632 def self.current
633 Thread.current[:current_user] ||= User.anonymous
633 RequestStore.store[:current_user] ||= User.anonymous
634 end
634 end
635
635
636 # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
636 # Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
General Comments 0
You need to be logged in to leave comments. Login now