Class: SupplejackApi::Admin::BaseController

Inherits:
SupplejackApi::ApplicationController show all
Defined in:
app/controllers/supplejack_api/admin/base_controller.rb

Direct Known Subclasses

SiteActivitiesController, UsersController

Instance Method Summary collapse

Methods inherited from SupplejackApi::ApplicationController

#authenticate_admin!, #authenticate_user!, #current_user, #find_user_set

Instance Method Details

#restrict_to_admin_users!Object


16
17
18
19
20
21
# File 'app/controllers/supplejack_api/admin/base_controller.rb', line 16

def restrict_to_admin_users!
  return if current_admin_user.admin?

  sign_out
  redirect_to new_admin_user_session_path, alert: t('admin.not_a_admin')
end