Class: Event::API::V2::Admin::BaseController

Inherits:
Event::ApplicationController show all
Includes:
JWTPayload
Defined in:
app/controllers/event/api/v2/admin/base_controller.rb

Direct Known Subclasses

EventsController

Constant Summary collapse

ADMIN_ROLES =
%w[superadmin admin accountant compliance support technical].freeze

Instance Method Summary collapse

Methods included from JWTPayload

#email, #jwt_payload, #role, #uid

Methods included from ExceptionHandlers

included

Methods included from Response

#controller_namespace, #error_response, #errors_response, #json_response, #not_found

Instance Method Details

#authorize_admin!Object

before_action :authorize_admin!



15
16
17
# File 'app/controllers/event/api/v2/admin/base_controller.rb', line 15

def authorize_admin!
  not_found unless role.to_s.in?(ADMIN_ROLES)
end