function AccessManagerWrapper::performCheck

1 call to AccessManagerWrapper::performCheck()
AccessManagerWrapper::check in webprofiler/src/Access/AccessManagerWrapper.php

File

webprofiler/src/Access/AccessManagerWrapper.php, line 60

Class

AccessManagerWrapper
Attaches access check services to routes and runs them on request.

Namespace

Drupal\webprofiler\Access

Code

protected function performCheck($service_id, ArgumentsResolverInterface $arguments_resolver, Request $request = NULL) {
    $callable = $this->checkProvider
        ->loadCheck($service_id);
    $arguments = $arguments_resolver->getArguments($callable);
    
    /** @var \Drupal\Core\Access\AccessResultInterface $service_access **/
    $service_access = call_user_func_array($callable, $arguments);
    if (!$service_access instanceof AccessResultInterface) {
        throw new AccessException("Access error in {$service_id}. Access services must return an object that implements AccessResultInterface.");
    }
    if ($request) {
        $this->dataCollector
            ->addAccessCheck($service_id, $callable, $request);
    }
    return $service_access;
}