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

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

Overview

Locking methods

Defined Under Namespace

Classes: LockdownSessionExpired

Instance Method Summary collapse

Instance Method Details

#check_request_authorizationObject



36
37
38
39
40
# File 'lib/lockdown/frameworks/rails/controller.rb', line 36

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

#configure_lockdownObject



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

def configure_lockdown
  Lockdown.maybe_parse_init
  check_session_expiry
  store_location
end

#set_current_userObject

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



28
29
30
31
32
33
34
# File 'lib/lockdown/frameworks/rails/controller.rb', line 28

def set_current_user
   unless logged_in?
  if logged_in?
    Thread.current[:who_did_it] = Lockdown::System.
      call(self, :who_did_it)
  end
end