app/controllers/locomotive/api/base_controller.rb in locomotive_cms-2.0.0.rc7 vs app/controllers/locomotive/api/base_controller.rb in locomotive_cms-2.0.0.rc8
- old
+ new
@@ -5,26 +5,29 @@
include Locomotive::Routing::SiteDispatcher
include Locomotive::ActionController::LocaleHelpers
skip_before_filter :verify_authenticity_token
- skip_load_and_authorize_resource
-
before_filter :require_account
before_filter :require_site
before_filter :set_locale
- # before_filter :validate_site_membership
+ before_filter :set_current_thread_variables
self.responder = Locomotive::ActionController::Responder # custom responder
respond_to :json, :xml
protected
+ def set_current_thread_variables
+ Thread.current[:account] = current_locomotive_account
+ Thread.current[:site] = current_site
+ end
+
def current_ability
@current_ability ||= Ability.new(current_locomotive_account, current_site)
end
def require_account
@@ -38,6 +41,6 @@
self.setup_i18n_fallbacks
end
end
end
-end
\ No newline at end of file
+end