Class: Tracks::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tracks/config.rb

Class Method Summary collapse

Class Method Details

.auth_schemesObject



5
6
7
# File 'lib/tracks/config.rb', line 5

def self.auth_schemes
   SITE_CONFIG['authentication_schemes'] || []
end

.cas_enabled?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/tracks/config.rb', line 13

def self.cas_enabled?
  auth_schemes.include?('cas')
end

.openid_enabled?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/tracks/config.rb', line 9

def self.openid_enabled?
  auth_schemes.include?('open_id')
end

.prefered_auth?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/tracks/config.rb', line 17

def self.prefered_auth?
  if SITE_CONFIG['prefered_auth']
    SITE_CONFIG['prefered_auth']
  else
    auth_schemes.first
  end
end