Class: Users::Services
- Inherits:
-
Object
- Object
- Users::Services
- Defined in:
- app/services/users/services.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #auth_free_services ⇒ Object private
-
#authorizations ⇒ Array<String>
Checks if the initialized user has authorization to access any of the below services.
-
#initialize(user) ⇒ Services
constructor
A new instance of Services.
Constructor Details
#initialize(user) ⇒ Services
Returns a new instance of Services.
9 10 11 12 |
# File 'app/services/users/services.rb', line 9 def initialize(user) @user = user @list = auth_free_services end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'app/services/users/services.rb', line 7 def user @user end |
Instance Method Details
#auth_free_services ⇒ Object (private)
39 40 41 42 43 44 45 46 47 |
# File 'app/services/users/services.rb', line 39 def auth_free_services [ BackendServices::FACILITIES, BackendServices::HCA, BackendServices::EDUCATION_BENEFITS, BackendServices::SAVE_IN_PROGRESS, BackendServices::FORM_PREFILL ] end |
#authorizations ⇒ Array<String>
Checks if the initialized user has authorization to access any of the below services. Returns an array of services they have access to.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/users/services.rb', line 19 def @list << BackendServices::RX if user. :mhv_prescriptions, :access? @list << BackendServices::MESSAGING if user. :mhv_messaging, :access? @list << BackendServices::MEDICAL_RECORDS if user. :mhv_medical_records, :access? @list << BackendServices::HEALTH_RECORDS if user. :mhv_health_records, :access? @list << BackendServices::EVSS_CLAIMS if user. :evss, :access? @list << BackendServices::LIGHTHOUSE if user. :lighthouse, :access? @list << BackendServices::FORM526 if user. :evss, :access_form526? @list << BackendServices::ADD_PERSON_PROXY if user. :mpi, :access_add_person_proxy? @list << BackendServices::USER_PROFILE if user.can_access_user_profile? @list << BackendServices::APPEALS_STATUS if user. :appeals, :access? @list << BackendServices::ID_CARD if user.can_access_id_card? @list << BackendServices::IDENTITY_PROOFED if user.loa3? @list << BackendServices::VET360 if user.can_access_vet360? @list end |