Module: EnforcesAdminAuthentication
- Extended by:
- ActiveSupport::Concern
- Included in:
- Admin::ApplicationController, Admin::ClustersController
- Defined in:
- app/controllers/concerns/enforces_admin_authentication.rb
Overview
EnforcesAdminAuthentication
Controller concern to enforce that users are authenticated as admins
Upon inclusion, adds ‘authenticate_admin!` as a before_action
Instance Method Summary collapse
Instance Method Details
#authenticate_admin! ⇒ Object
23 24 25 |
# File 'app/controllers/concerns/enforces_admin_authentication.rb', line 23 def authenticate_admin! attempt_admin_mode unless current_user&.can_admin_all_resources? end |
#storable_location? ⇒ Boolean
27 28 29 |
# File 'app/controllers/concerns/enforces_admin_authentication.rb', line 27 def storable_location? request.path != new_admin_session_path end |