Exception: Sipity::Exceptions::AuthorizationFailureError

Inherits:
RuntimeError
  • Object
show all
Defined in:
app/exceptions/sipity/exceptions.rb

Overview

Exposing a custom AuthorizationFailureError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user:, policy_question:, entity:) ⇒ AuthorizationFailureError

Returns a new instance of AuthorizationFailureError



80
81
82
83
# File 'app/exceptions/sipity/exceptions.rb', line 80

def initialize(user:, policy_question:, entity:)
  @user, @policy_question, @entity = user, policy_question, entity
  super("#{user} not allowed to #{policy_question} this #{entity}")
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity



79
80
81
# File 'app/exceptions/sipity/exceptions.rb', line 79

def entity
  @entity
end

#policy_questionObject (readonly)

Returns the value of attribute policy_question



79
80
81
# File 'app/exceptions/sipity/exceptions.rb', line 79

def policy_question
  @policy_question
end

#userObject (readonly)

Returns the value of attribute user



79
80
81
# File 'app/exceptions/sipity/exceptions.rb', line 79

def user
  @user
end