Class: Metadatastore::API::V2::Admin::BaseController

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

Direct Known Subclasses

MetadataController

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



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

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