Module: Wobauth

Defined in:
lib/wobauth.rb,
lib/wobauth/engine.rb,
lib/wobauth/version.rb,
app/models/wobauth/role.rb,
app/models/wobauth/user.rb,
app/models/wobauth/group.rb,
app/models/wobauth/ad_user.rb,
app/models/wobauth/authority.rb,
app/models/wobauth/membership.rb,
app/models/wobauth/admin_ability.rb,
app/helpers/wobauth/ad_users_helper.rb,
app/helpers/wobauth/application_helper.rb,
app/helpers/wobauth/authorities_helper.rb,
app/controllers/wobauth/login_controller.rb,
app/controllers/wobauth/roles_controller.rb,
app/controllers/wobauth/users_controller.rb,
lib/generators/wobauth/install_generator.rb,
app/controllers/wobauth/groups_controller.rb,
app/controllers/wobauth/ad_users_controller.rb,
app/services/wobauth/search_ad_user_service.rb,
app/controllers/wobauth/application_controller.rb,
app/controllers/wobauth/authorities_controller.rb,
app/controllers/wobauth/memberships_controller.rb,
app/controllers/wobauth/registrations_controller.rb,
app/controllers/wobauth/users/authorities_controller.rb,
app/controllers/wobauth/users/memberships_controller.rb,
app/controllers/wobauth/groups/authorities_controller.rb,
app/controllers/wobauth/groups/memberships_controller.rb

Defined Under Namespace

Modules: AdUsersHelper, ApplicationHelper, AuthoritiesHelper, Generators Classes: AdUser, AdUsersController, AdminAbility, ApplicationController, AuthoritiesController, Authority, Engine, Group, GroupsController, LoginController, Membership, MembershipsController, RegistrationsController, Role, RolesController, SearchAdUserService, User, UsersController

Constant Summary collapse

VERSION =
"6.0.1".freeze
RELEASEDATE =
"2021-09-18".freeze
@@authorizable_types =
[ "Wobauth::User", "Wobauth::Group" ]
@@authorizable_group_method =
:all
@@authorized_for_types =
[ ]
@@authorized_for_group_method =
:all
@@remote_authentication =
nil
@@ldap_config =
nil

Class Method Summary collapse

Class Method Details

.ldap_optionsObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/wobauth.rb', line 40

def self.ldap_options
  return {} if @@ldap_config.blank?
  if File.readable? @@ldap_config
    config = YAML.load_file(@@ldap_config)
  end
  config ||= Hash.new

  if config['ldap_options'].present?
    ldapopts = config['ldap_options']
    if ldapopts.kind_of? Hash
      ldapopts = [ldapopts]
    end
    ldapopts.each do |opts|
      opts.symbolize_keys!
      opts.each do |k,v|
        opts[k] = opts[k].symbolize_keys if opts[k].kind_of? Hash
      end
    end
  else
    nil
  end
end

.remote_authentication?Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
# File 'lib/wobauth.rb', line 27

def self.remote_authentication?
  if @@remote_authentication.nil?
    @@remote_authentication = User.devise_modules.include?(:remote_user_authenticatable)
  end
  @@remote_authentication
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Wobauth)

    the object that the method was called on



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

def self.setup
  yield self
end