class Authz::Controllers::AuthorizationManager::NotAuthorized

Error that will be raised if a user is not authorized

Attributes

action[R]
controller[R]
instance[R]
rolable[R]

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method
# File lib/authz/controllers/authorization_manager.rb, line 42
def initialize(options = {})
  @rolable = options.fetch :rolable
  @controller = options.fetch :controller
  @action = options.fetch :action
  @instance = options.fetch(:instance, nil)

  msg = "#{rolable.class} #{rolable.id} " \
            'does not have a role that allows him to ' \
            "#{controller}##{action}"

  if instance.present?
    msg += " on #{instance}."
  end

  super(msg)
end