Module: EVSS::Authorizeable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/controllers/concerns/evss/authorizeable.rb
Instance Method Summary collapse
- #authorize_evss! ⇒ Object
- #error_detail ⇒ Object private
-
#missing_values ⇒ String
private
Returns a comma-separated string of the user’s blank attributes.
Instance Method Details
#authorize_evss! ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/concerns/evss/authorizeable.rb', line 7 def unless EVSSPolicy.new(@current_user, :evss).access? raise Common::Exceptions::Forbidden.new(detail: error_detail, source: 'EVSS') end end |
#error_detail ⇒ Object (private)
15 16 17 |
# File 'app/controllers/concerns/evss/authorizeable.rb', line 15 def error_detail "User does not have access to the requested resource due to missing values: #{missing_values}" end |
#missing_values ⇒ String (private)
Returns a comma-separated string of the user’s blank attributes. ‘participant_id` is AKA `corp_id`.
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/concerns/evss/authorizeable.rb', line 23 def missing_values missing = [] missing << 'corp_id' if @current_user.participant_id.blank? missing << 'edipi' if @current_user.edipi.blank? missing << 'ssn' if @current_user.ssn.blank? missing.join(', ') end |