Exception: Oso::NotFoundError
- Inherits:
-
AuthorizationError
- Object
- RuntimeError
- Error
- AuthorizationError
- Oso::NotFoundError
- Defined in:
- lib/oso/errors.rb
Overview
Thrown by the authorize
method of an Oso
instance. This error indicates that the actor is not only not allowed to perform the given action, but also is not allowed to “read” the given resource.
Most of the time, your app should handle this error by returning a 404 HTTP error to the client.
To control which action is used for the distinction between NotFoundError
and ForbiddenError
, you can customize the read_action
on your Oso
instance.
Instance Method Summary collapse
-
#initialize ⇒ NotFoundError
constructor
A new instance of NotFoundError.
Constructor Details
#initialize ⇒ NotFoundError
Returns a new instance of NotFoundError.
36 37 38 39 40 41 42 |
# File 'lib/oso/errors.rb', line 36 def initialize super( 'Oso NotFoundError -- The current user does not have permission to read ' \ 'the given resource. You should handle this error by returning a 404 ' \ 'error to the client.' ) end |