class FunWithJsonApi::Exceptions::UnauthorizedResource
Indicates a Resource or Collection item not authorized
Public Class Methods
new(message, payload = ExceptionPayload.new)
click to toggle source
Calls superclass method
FunWithJsonApi::Exception::new
# File lib/fun_with_json_api/exceptions/unauthorized_resource.rb, line 5 def initialize(message, payload = ExceptionPayload.new) payload = Array.wrap(payload).each do |unauthorized| unauthorized.code ||= 'unauthorized_resource' unauthorized.title ||= I18n.t('unauthorized_resource', scope: 'fun_with_json_api.exceptions') unauthorized.status ||= '403' end super end