class Admin::DashboardController < ApplicationController
  layout 'admin'

  before_action :authenticate_user!
  before_action :require_admin

  # GET /admin
  def index

  end

  private

  def require_admin
    current_user.admin?
  end
end

class Admin::DashboardController < ApplicationController
  layout 'admin'

  before_action :authenticate_user!
  before_action :require_admin

  # GET /admin
  def index

  end

  private

  def require_admin
    # redirect_to root_path, notice: "#{t 'authorization.admin.unauthorized'}" unless current_user.admin?
    redirect_to root_path unless current_user.admin?
  end
end

Fix Admin before action checking Admin user status
Fix Admin before action checking Admin user status

If a user is not an admin, redirect them back to the home page.
Optionally, we can flash a message stating that they do not have the
proper authorization to access the interface, but that may be revealing
too much information.
