class Pundit::NotAuthorizedError

Error that will be raised when authorization has failed

def initialize(options = {})

def initialize(options = {})
  if options.is_a? String
    message = options
  else
    @query  = options[:query]
    @record = options[:record]
    @policy = options[:policy]
    message = options.fetch(:message) { "not allowed to #{query} this #{record.class}" }
  end
  super(message)
end