module ActiveAdmin::BaseController::Authorization

def authorize!(action, subject = nil)

Returns:
  • (Boolean) - True if authorized, otherwise raises

Parameters:
  • subject (any) -- The subject that the user is trying to perform
  • action (Symbol) -- The action to check if the user has permission
def authorize!(action, subject = nil)
  unless authorized? action, subject
    raise ActiveAdmin::AccessDenied.new(
      current_active_admin_user,
      action,
      subject)
  end
end