Class: LighthousePolicy
- Inherits:
-
Struct
- Object
- Struct
- LighthousePolicy
- Defined in:
- app/policies/lighthouse_policy.rb
Instance Attribute Summary collapse
-
#lighthouse ⇒ Object
Returns the value of attribute lighthouse.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #access? ⇒ Boolean (also: #rating_info_access?)
- #access_update? ⇒ Boolean (also: #mobile_access?)
- #allowed_providers ⇒ Object private
- #direct_deposit_access? ⇒ Boolean
- #itf_access? ⇒ Boolean
Instance Attribute Details
#lighthouse ⇒ Object
Returns the value of attribute lighthouse
3 4 5 |
# File 'app/policies/lighthouse_policy.rb', line 3 def lighthouse @lighthouse end |
#user ⇒ Object
Returns the value of attribute 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?
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?
20 21 22 23 24 |
# File 'app/policies/lighthouse_policy.rb', line 20 def access_update? user.loa3? && allowed_providers.include?(user.identity.sign_in[:service_name]) && user.icn.present? && user.participant_id.present? end |
#allowed_providers ⇒ Object (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
8 9 10 11 12 |
# File 'app/policies/lighthouse_policy.rb', line 8 def direct_deposit_access? user.loa3? && allowed_providers.include?(user.identity.sign_in[:service_name]) && user.icn.present? && user.participant_id.present? end |
#itf_access? ⇒ 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 |