performCheck example

// Filter out checks which require the incoming request.     if (!isset($request)) {
      $checks = array_diff($checks$this->checkProvider->getChecksNeedRequest());
    }

    $result = AccessResult::neutral();
    if (!empty($checks)) {
      $arguments_resolver = $this->argumentsResolverFactory->getArgumentsResolver($route_match$account$request);
      $result = AccessResult::allowed();
      foreach ($checks as $service_id) {
        $result = $result->andIf($this->performCheck($service_id$arguments_resolver));
      }
    }
    return $return_as_object ? $result : $result->isAllowed();
  }

  /** * Performs the specified access check. * * @param string $service_id * The access check service ID to use. * @param \Drupal\Component\Utility\ArgumentsResolverInterface $arguments_resolver * The parametrized arguments resolver instance. * * @return \Drupal\Core\Access\AccessResultInterface * The access result. * * @throws \Drupal\Core\Access\AccessException * Thrown when the access check returns an invalid value. */
Home | Imprint | This part of the site doesn't use cookies.