Class: LighthousePolicy

Inherits:
Struct
  • Object
show all
Defined in:
app/policies/lighthouse_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lighthouseObject

Returns the value of attribute lighthouse

Returns:

  • (Object)

    the current value of lighthouse



3
4
5
# File 'app/policies/lighthouse_policy.rb', line 3

def lighthouse
  @lighthouse
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



3
4
5
# File 'app/policies/lighthouse_policy.rb', line 3

def user
  @user
end

Instance Method Details

#access?Boolean Also known as: rating_info_access?

Returns:

  • (Boolean)


4
5
6
# File 'app/policies/lighthouse_policy.rb', line 4

def access?
  user.icn.present? && user.participant_id.present?
end

#access_update?Boolean Also known as: mobile_access?

Returns:

  • (Boolean)


20
21
22
23
24
# File 'app/policies/lighthouse_policy.rb', line 20

def access_update?
  user.loa3? &&
    allowed_providers.include?(user.identity.[:service_name]) &&
    user.icn.present? && user.participant_id.present?
end

#allowed_providersObject (private)



31
32
33
34
35
36
37
38
# File 'app/policies/lighthouse_policy.rb', line 31

def allowed_providers
  %w[
    idme
    oauth_IDME
    logingov
    oauth_LOGINGOV
  ].freeze
end

#direct_deposit_access?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'app/policies/lighthouse_policy.rb', line 8

def direct_deposit_access?
  user.loa3? &&
    allowed_providers.include?(user.identity.[:service_name]) &&
    user.icn.present? && user.participant_id.present?
end

#itf_access?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
# File 'app/policies/lighthouse_policy.rb', line 14

def itf_access?
  # Need to check for first name as Lighthouse will check for it
  # and throw an error if it's nil
  user.participant_id.present? && user.ssn.present? && user.last_name.present? && user.first_name
end