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



32
33
34
35
36
# File 'lib/lockdown/frameworks/rails/controller.rb', line 32

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

#configure_lockdownObject



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

def configure_lockdown
  check_session_expiry
  store_location
end

#set_current_userObject

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



24
25
26
27
28
29
30
# File 'lib/lockdown/frameworks/rails/controller.rb', line 24

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