Jinya CMS

AuthorizationMiddleware
in package
implements MiddlewareInterface

The authorization middleware checks the authorization and sets the currently logged-in user

Tags

Interfaces, Classes, Traits and Enums

MiddlewareInterface

Table of Contents

LOGGED_IN_ARTIST  = 'logged_in_artist'
$role  : string|null
__construct()  : mixed
Creates a new authorization middleware and initializes it with the needed role
process()  : ResponseInterface
Processes the middleware, during the processing the logged-in user will be checked against the role, and the current user will be set to the user from the request

Constants

LOGGED_IN_ARTIST

public string LOGGED_IN_ARTIST = 'logged_in_artist'

Constant for the currently logged-in user

Tags

Properties

Methods

__construct()

Creates a new authorization middleware and initializes it with the needed role

public __construct([string|null $role = null ]) : mixed
Parameters
$role : string|null = null
Tags
Return values
mixed

process()

Processes the middleware, during the processing the logged-in user will be checked against the role, and the current user will be set to the user from the request

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Tags
throws
JsonException
Return values
ResponseInterface

Search results