interface CheckProviderInterface (View source)

Provides the available access checkers by service IDs.

Access checker services are added by ::addCheckService calls and are loaded by ::loadCheck.

The checker provider service and the actual checking is separated in order to not require the full access manager on route build time.

Methods

setChecks(RouteCollection $routes)

For each route, saves a list of applicable access checks to the route.

addCheckService(string $service_id, string $service_method, array $applies_checks = [], bool $needs_incoming_request = FALSE)

Registers a new AccessCheck by service ID.

callable
loadCheck(string $service_id)

Lazy-loads access check services.

array
getChecksNeedRequest()

A list of checks that needs the request.

Details

setChecks(RouteCollection $routes)

For each route, saves a list of applicable access checks to the route.

Parameters

RouteCollection $routes

A collection of routes to apply checks to.

addCheckService(string $service_id, string $service_method, array $applies_checks = [], bool $needs_incoming_request = FALSE)

Registers a new AccessCheck by service ID.

Parameters

string $service_id

The ID of the service in the Container that provides a check.

string $service_method

The method to invoke on the service object for performing the check.

array $applies_checks

(optional) An array of route requirement keys the checker service applies to.

bool $needs_incoming_request

(optional) True if access-check method only acts on an incoming request.

callable loadCheck(string $service_id)

Lazy-loads access check services.

Parameters

string $service_id

The service id of the access check service to load.

Return Value

callable

A callable access check.

Exceptions

InvalidArgumentException
AccessException

array getChecksNeedRequest()

A list of checks that needs the request.

Return Value

array