Sha256: 2141e23da7e6bc6c5a26478cc2ae525494d43ab0960f6080b8dd8d054d3df3aa

Contents?: true

Size: 557 Bytes

Versions: 8

Compression:

Stored size: 557 Bytes

Contents

class BaseController < ActionController::Base
  layout 'rails_performance/layouts/rails_performance'

  before_action :verify_access

  if RailsPerformance.http_basic_authentication_enabled
    http_basic_authenticate_with \
      name: RailsPerformance.http_basic_authentication_user_name,
      password: RailsPerformance.http_basic_authentication_password
  end

  private

  def verify_access
    result = RailsPerformance.verify_access_proc.call(self)
    redirect_to('/', error: 'Access Denied', status: 401) unless result
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_performance-0.9.4 app/controllers/base_controller.rb
rails_performance-0.9.3 app/controllers/base_controller.rb
rails_performance-0.9.2 app/controllers/base_controller.rb
rails_performance-0.9.1 app/controllers/base_controller.rb
rails_performance-0.9.0.1 app/controllers/base_controller.rb
rails_performance-0.9.0 app/controllers/base_controller.rb
rails_performance-0.0.1.19 app/controllers/base_controller.rb
rails_performance-0.0.1.15 app/controllers/base_controller.rb