Class: MPIPolicy
- Inherits:
-
Struct
- Object
- Struct
- MPIPolicy
- Defined in:
- app/policies/mpi_policy.rb
Instance Attribute Summary collapse
-
#mvi ⇒ Object
Returns the value of attribute mvi.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #access_add_person_proxy? ⇒ Boolean
- #queryable? ⇒ Boolean
- #required_attrs_present?(user) ⇒ Boolean private
Instance Attribute Details
#mvi ⇒ Object
Returns the value of attribute mvi
3 4 5 |
# File 'app/policies/mpi_policy.rb', line 3 def mvi @mvi end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/policies/mpi_policy.rb', line 3 def user @user end |
Instance Method Details
#access_add_person_proxy? ⇒ Boolean
4 5 6 |
# File 'app/policies/mpi_policy.rb', line 4 def access_add_person_proxy? user.edipi.present? && user.ssn.present? && (user.birls_id.blank? || user.participant_id.blank?) end |
#queryable? ⇒ Boolean
8 9 10 |
# File 'app/policies/mpi_policy.rb', line 8 def queryable? user.icn.present? || required_attrs_present?(user) end |
#required_attrs_present?(user) ⇒ Boolean (private)
14 15 16 17 18 19 20 21 22 |
# File 'app/policies/mpi_policy.rb', line 14 def required_attrs_present?(user) return false if user.first_name.blank? return false if user.last_name.blank? return false if user.birth_date.blank? return false if user.ssn.blank? return false if user.gender.blank? true end |