Module: OpenStax::Utilities::Access

Defined in:
lib/openstax/utilities/access.rb

Class Method Summary collapse

Class Method Details

.protect_beta(options = {}) ⇒ Object

Called in a controller to provide an outer level of basic HTTP authentication, typically used when code is deployed during development and it is not yet ready for public consumption.

Examples:

Basic usage

class ApplicationController < ActionController::Base
  protect_beta :username => 'bob',
               :password => '123'


47
48
49
# File 'lib/openstax/utilities/access.rb', line 47

def self.protect_beta(options={})
  # Just here for documentation purposes, see code above
end

.skip_protect_beta(options = {}) ⇒ Object

Called in a controller to skip the beta protection enabled elsewhere (e.g. in a parent controller). Takes options like skip_before_filter

Examples:

Usage to skip beta protection on index action

class MyController < ApplicationController
  skip_protect_beta :except => [:index]


61
62
63
# File 'lib/openstax/utilities/access.rb', line 61

def self.skip_protect_beta(options={})
  # Just here for documentation purposes, see code above
end