class UnauthorizedException extends HttpException

Methods

forRoles(array $roles)

Create an exception for missing roles.

forPermissions(array $permissions)

Create an exception for missing permissions.

forRolesOrPermissions(array $rolesOrPermissions)

Create an exception for missing roles or permissions.

missingTraitHasRoles(object $user)

Create an exception for a user missing the HasRoles trait.

notLoggedIn()

Create an exception for a missing authenticated user.

array
getRequiredRoles()

Get the roles required by the failed check.

array
getRequiredPermissions()

Get the permissions required by the failed check.

Details

at line 31
static UnauthorizedException forRoles(array $roles)

Create an exception for missing roles.

Parameters

array $roles

Return Value

UnauthorizedException

at line 50
static UnauthorizedException forPermissions(array $permissions)

Create an exception for missing permissions.

Parameters

array $permissions

Return Value

UnauthorizedException

at line 69
static UnauthorizedException forRolesOrPermissions(array $rolesOrPermissions)

Create an exception for missing roles or permissions.

Parameters

array $rolesOrPermissions

Return Value

UnauthorizedException

at line 86
static UnauthorizedException missingTraitHasRoles(object $user)

Create an exception for a user missing the HasRoles trait.

Parameters

object $user

Return Value

UnauthorizedException

at line 96
static UnauthorizedException notLoggedIn()

Create an exception for a missing authenticated user.

Return Value

UnauthorizedException

at line 106
array getRequiredRoles()

Get the roles required by the failed check.

Return Value

array

at line 116
array getRequiredPermissions()

Get the permissions required by the failed check.

Return Value

array