UserRole
in package
implements
MiddlewareInterface
Validates that access was performed by user with the specified role.
Returns HTTP 403 if current user's role is not in the allowed ones.
Tags
Interfaces, Classes and Traits
- MiddlewareInterface
Table of Contents
- ROLE_ADMIN = 'admin'
- Plesk administrator
- ROLE_ADMIN_ALIAS = 'admin-alias'
- Additional admin account
- ROLE_CLIENT = 'client'
- Client user
- ROLE_RESELLER = 'reseller'
- Reseller user
- ROLE_SERVICE = 'service'
- Additional user of the subscription
- __construct() : mixed
- process() : ResponseInterface
Constants
ROLE_ADMIN
Plesk administrator
public
mixed
ROLE_ADMIN
= 'admin'
Tags
ROLE_ADMIN_ALIAS
Additional admin account
public
mixed
ROLE_ADMIN_ALIAS
= 'admin-alias'
Tags
ROLE_CLIENT
Client user
public
mixed
ROLE_CLIENT
= 'client'
Tags
ROLE_RESELLER
Reseller user
public
mixed
ROLE_RESELLER
= 'reseller'
Tags
ROLE_SERVICE
Additional user of the subscription
public
mixed
ROLE_SERVICE
= 'service'
Tags
Methods
__construct()
public
__construct(ResponseFactoryInterface $factory[, array<string|int, mixed> $roles = ['admin', 'admin-alias', 'client', 'reseller', 'service'] ]) : mixed
Parameters
- $factory : ResponseFactoryInterface
- $roles : array<string|int, mixed> = ['admin', 'admin-alias', 'client', 'reseller', 'service']
Return values
mixed —process()
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface