Exception: Administrate::NotAuthorizedError
- Inherits:
-
StandardError
- Object
- StandardError
- Administrate::NotAuthorizedError
- Defined in:
- lib/administrate/not_authorized_error.rb
Instance Method Summary collapse
-
#initialize(action:, resource:) ⇒ NotAuthorizedError
constructor
A new instance of NotAuthorizedError.
Constructor Details
#initialize(action:, resource:) ⇒ NotAuthorizedError
Returns a new instance of NotAuthorizedError.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/administrate/not_authorized_error.rb', line 3 def initialize(action:, resource:) @action = action @resource = resource case resource when String, Symbol super("Not allowed to perform #{action.inspect} on #{resource.inspect}") when Module super("Not allowed to perform #{action.inspect} on #{resource.name}") else super( "Not allowed to perform #{action.inspect} on the given " + resource.class.name ) end end |