Module: Lockdown::Frameworks::Rails::Controller::Lock

Defined in:
lib/lockdown/frameworks/rails/controller.rb

Overview

Locking methods

Instance Method Summary collapse

Instance Method Details

#check_request_authorizationObject



21
22
23
24
25
26
# File 'lib/lockdown/frameworks/rails/controller.rb', line 21

def check_request_authorization
  unless authorized?(path_from_hash(params))
    parameters = respond_to?(:filter_parameters) ? filter_parameters(params) : params.dup
    raise SecurityError, "Authorization failed! \nparams: #{parameters.inspect}\nsession: #{session.inspect}"
  end
end

#configure_lockdownObject



8
9
10
# File 'lib/lockdown/frameworks/rails/controller.rb', line 8

def configure_lockdown
  store_location
end

#set_current_userObject

Basic auth functionality needs to be reworked as Lockdown doesn’t provide authentication functionality.



14
15
16
17
18
19
# File 'lib/lockdown/frameworks/rails/controller.rb', line 14

def set_current_user
  if logged_in?
    whodat = send(Lockdown::Configuration.who_did_it)
    Thread.current[:who_did_it] = whodat
  end
end