Class: Madmin::ApplicationController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Madmin::ApplicationController
- Defined in:
- app/controllers/madmin/application_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#authenticate_admin_user ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/madmin/application_controller.rb', line 7 def authenticate_admin_user # TODO: Add your authentication logic here # For example, with Rails 8 authentication # redirect_to "/", alert: "Not authorized." unless authenticated? && Current.user.admin? # Or with Devise # redirect_to "/", alert: "Not authorized." unless current_user&.admin? end |