Class: BGSPolicy
- Inherits:
-
Struct
- Object
- Struct
- BGSPolicy
- Defined in:
- app/policies/bgs_policy.rb
Instance Attribute Summary collapse
-
#bgs ⇒ Object
Returns the value of attribute bgs.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#bgs ⇒ Object
Returns the value of attribute bgs
3 4 5 |
# File 'app/policies/bgs_policy.rb', line 3 def bgs @bgs end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/policies/bgs_policy.rb', line 3 def user @user end |
Instance Method Details
#access?(log_stats: true) ⇒ Boolean
4 5 6 7 8 |
# File 'app/policies/bgs_policy.rb', line 4 def access?(log_stats: true) accessible = user.icn.present? && user.ssn.present? && user.participant_id.present? increment_statsd(accessible) if user.loa3? && log_stats accessible end |
#increment_statsd(accessible) ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/policies/bgs_policy.rb', line 10 def increment_statsd(accessible) if accessible StatsD.increment('api.bgs.policy.success') else StatsD.increment('api.bgs.policy.failure') end end |