AuthorizationException
extends ApiException
in package
Thrown from an authorize() method to deny access with a custom error message.
Uses a fixed UNAUTHORIZED error code and 401 status. The message defaults to a generic denial but can be overridden for more specific feedback.
Table of Contents
- __construct() : mixed
- Constructor.
- getErrorCode() : string
- Get the machine-readable error code.
- getExtensions() : array<string|int, mixed>
- Get the additional error metadata.
- getStatusCode() : int
- Get the HTTP status code.
Methods
__construct()
Constructor.
public
__construct([string $message = 'You do not have permission to perform this action.' ][, Throwable|null $previous = null ]) : mixed
Parameters
- $message : string = 'You do not have permission to perform this action.'
-
The error message.
- $previous : Throwable|null = null
-
The previous throwable for chaining.
Return values
mixed —getErrorCode()
Get the machine-readable error code.
public
getErrorCode() : string
Return values
string —getExtensions()
Get the additional error metadata.
public
getExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStatusCode()
Get the HTTP status code.
public
getStatusCode() : int
