Module: UCB::Rails::Security

Defined in:
lib/ucb_rails_security.rb,
lib/helpers/rspec_helpers.rb,
lib/ucb_rails_security_logger.rb,
lib/ucb_rails_security_casauthentication.rb

Overview

:nodoc:

Defined Under Namespace

Modules: RspecHelpers Classes: CASAuthentication, Logger

Class Method Summary collapse

Class Method Details

.loggerObject



51
52
53
# File 'lib/ucb_rails_security.rb', line 51

def self.logger
  @logger ||= UCB::Rails::Security::Logger.new("#{RAILS_ROOT}/log/ucb_security_#{RAILS_ENV}.log")
end

.logger=(val) ⇒ Object



55
56
57
# File 'lib/ucb_rails_security.rb', line 55

def self.logger=(val)
  @logger = val
end

.not_authorized_urlObject

URL user is redirected to when authorization fails. Defaults to ‘/not_authorized’



36
37
38
# File 'lib/ucb_rails_security.rb', line 36

def self.not_authorized_url()
  @not_authorized_url || '/not_authorized'
end

.not_authorized_url=(url) ⇒ Object

Setter for not_authorized_url()



41
42
43
# File 'lib/ucb_rails_security.rb', line 41

def self.not_authorized_url=(url)
  @not_authorized_url = url
end

.reset_instance_variablesObject

Reset instance variables for testing



46
47
48
49
# File 'lib/ucb_rails_security.rb', line 46

def self.reset_instance_variables() #:nodoc:
  self.using_user_table = nil
  self.not_authorized_url = nil
end

.using_user_table=(bool) ⇒ Object

Set this to true if your application is using a User table.



30
31
32
# File 'lib/ucb_rails_security.rb', line 30

def self.using_user_table=(bool)
  @using_user_table = bool
end

.using_user_table?Boolean

Returns true if application is using a user table which must be named User.

Returns:

  • (Boolean)


25
26
27
# File 'lib/ucb_rails_security.rb', line 25

def self.using_user_table?
  @using_user_table
end