Exception: Granite::Action::NotAllowedError

Inherits:
Error
  • Object
show all
Defined in:
lib/granite/action/policies.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Error

#action

Instance Method Summary collapse

Constructor Details

#initialize(action) ⇒ NotAllowedError

Returns a new instance of NotAllowedError.



9
10
11
12
13
14
# File 'lib/granite/action/policies.rb', line 9

def initialize(action)
  performer_id = "##{action.performer.id}" if action.performer.respond_to?(:id) && action.performer.id.present?

  super("#{action.class} action is not allowed " \
        "for #{action.performer.class}#{performer_id}", action)
end