RavSystem API docs

AuthorizationMiddleware extends BaseAuthorizationMiddleware
in package

Table of Contents

$accessRepository  : IAccessRepository
$logger  : LoggerInterface
$request  : ServerRequestInterface
HTTP request
$subject  : string
$subjectId  : int|null
$userAccess  : Access
$reservationRepository  : IReservationRepository
$userRepository  : IUserRepository
__construct()  : mixed
process()  : ResponseInterface
abstracts away logic needed for all other middlewares
getMethod()  : string
gets method of the request
getPath()  : string
gets path of the request
getSession()  : object
returns session object with token data
processRequest()  : ResponseInterface
Process an incoming server request
resolveAccess()  : bool
returns false if user doesn't have an access to operation
getResolver()  : callable
returns access resolver function for the current user
resolvePremisesAccess()  : bool
validates if user has access to 'premises resources'
resolveReservationAccess()  : bool
validates if user has access to reservations functionality
resolveUserAccess()  : bool
Validates if the user has access to edit user
setRequestSubject()  : void
gets subject and subject id (if exists) from the request path i.e: /users/1 => subject = 'users'; subjectId = 1

Properties

Methods

process()

abstracts away logic needed for all other middlewares

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

getMethod()

gets method of the request

protected getMethod() : string
Return values
string

getPath()

gets path of the request

protected getPath() : string
Return values
string

getSession()

returns session object with token data

protected getSession() : object
Return values
object

processRequest()

Process an incoming server request

protected abstract processRequest(RequestHandlerInterface $handler) : ResponseInterface
Parameters
$handler : RequestHandlerInterface
Return values
ResponseInterface

resolveAccess()

returns false if user doesn't have an access to operation

protected resolveAccess() : bool
Return values
bool

getResolver()

returns access resolver function for the current user

private getResolver() : callable
Return values
callable

resolvePremisesAccess()

validates if user has access to 'premises resources'

private resolvePremisesAccess() : bool
Return values
bool

resolveReservationAccess()

validates if user has access to reservations functionality

private resolveReservationAccess() : bool
Return values
bool

resolveUserAccess()

Validates if the user has access to edit user

private resolveUserAccess() : bool
Return values
bool

setRequestSubject()

gets subject and subject id (if exists) from the request path i.e: /users/1 => subject = 'users'; subjectId = 1

private setRequestSubject() : void
Return values
void

Search results