Class: RailsIam::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_iam/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rails_iam/configuration.rb', line 9

def initialize
  # Each concern has its own configuration object to keep the
  @authorization = RailsIam::Config::Authorization.new
  @jwt = RailsIam::Config::Jwt.new
  @authentication = RailsIam::Config::Authentication.new

  # Host Application User Model, defaults to RailsIam::User
  # Used throughout RailsIam for authentication, authorization associations, and user lookup.
  @user_class = "RailsIam::User"

  # Current User Resolver, defaults to current_user
  # Method used by RailsIam to obtain the authenticated user when
  # the host application already manages authentication (e.g. Devise,)
  @current_user_method = :current_user

  # Audit performer method
  # Used to audit who created/assigned what permission
  # support symbol both symbol and proc i,e ->(user) { "#{user.id}:#{user.username}" }
  @audit_performer_method = :email
end

Instance Attribute Details

#audit_performer_methodObject

Returns the value of attribute audit_performer_method.



7
8
9
# File 'lib/rails_iam/configuration.rb', line 7

def audit_performer_method
  @audit_performer_method
end

#authenticationObject (readonly)

Returns the value of attribute authentication.



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

def authentication
  @authentication
end

#authorizationObject (readonly)

Returns the value of attribute authorization.



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

def authorization
  @authorization
end

#current_user_methodObject

Returns the value of attribute current_user_method.



7
8
9
# File 'lib/rails_iam/configuration.rb', line 7

def current_user_method
  @current_user_method
end

#jwtObject (readonly)

Returns the value of attribute jwt.



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

def jwt
  @jwt
end

#user_classObject

Returns the value of attribute user_class.



7
8
9
# File 'lib/rails_iam/configuration.rb', line 7

def user_class
  @user_class
end