Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#validate_credentialsObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/application_controller.rb', line 9

def validate_credentials
  @active_credential = Credential.find session[:credential_id] if session[:credential_id]

  unless Credential.guest_permitted? params[:controller], params[:action]
    if @active_credential
      render :file => "#{RAILS_ROOT}/public/500.html", :status => 500 unless @active_credential.is_request_permitted?( params[:controller], params[:action] )
    else
      session[:uncredentialed_request_uri] = request.request_uri

      redirect_to 
    end
  end
end