PHP Class FluxBB\Server\AuthorizationServer

Inheritance: implements FluxBB\Server\ServerInterface
Show file Open project: fluxbb/core

Protected Properties

Property Type Description
$authorizers array The authorizer classes for registered handlers.
$container Illuminate\Contracts\Container\Container The container instance.
$next FluxBB\Server\ServerInterface The wrapped server instance.

Public Methods

Method Description
__construct ( Illuminate\Contracts\Container\Container $container, FluxBB\Server\ServerInterface $next ) Create the authorization server instance.
dispatch ( Request $request ) : Response Resolve the request and return a response.
registerAuthorizer ( string $name, string $authorizerClass ) Register an authorizer to be used for a given action.

Protected Methods

Method Description
authorize ( Request $request ) : void Authorize the given request.
getSubject ( ) : FluxBB\Models\HasPermissions Get the authorization subject from the environment.
resolveAuthorizer ( Request $request ) : Authorizer | null Resolve the matching authorizer instance.

Method Details

__construct() public method

Create the authorization server instance.
public __construct ( Illuminate\Contracts\Container\Container $container, FluxBB\Server\ServerInterface $next )
$container Illuminate\Contracts\Container\Container
$next FluxBB\Server\ServerInterface

authorize() protected method

Authorize the given request.
protected authorize ( Request $request ) : void
$request Request
return void

dispatch() public method

Resolve the request and return a response.
public dispatch ( Request $request ) : Response
$request Request
return Response

getSubject() protected method

Get the authorization subject from the environment.
protected getSubject ( ) : FluxBB\Models\HasPermissions
return FluxBB\Models\HasPermissions

registerAuthorizer() public method

Register an authorizer to be used for a given action.
public registerAuthorizer ( string $name, string $authorizerClass )
$name string
$authorizerClass string

resolveAuthorizer() protected method

Resolve the matching authorizer instance.
protected resolveAuthorizer ( Request $request ) : Authorizer | null
$request Request
return FluxBB\Auth\Authorizer | null

Property Details

$authorizers protected property

The authorizer classes for registered handlers.
protected array $authorizers
return array

$container protected property

The container instance.
protected Container,Illuminate\Contracts\Container $container
return Illuminate\Contracts\Container\Container

$next protected property

The wrapped server instance.
protected ServerInterface,FluxBB\Server $next
return FluxBB\Server\ServerInterface