class RegisterAccessChecksPass

Adds services tagged 'access_check' to the access_manager service.

Hierarchy

Expanded class hierarchy of RegisterAccessChecksPass

1 file declares its use of RegisterAccessChecksPass
CoreBundle.php in drupal/core/lib/Drupal/Core/CoreBundle.php
Definition of Drupal\Core\CoreBundle.

File

drupal/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterAccessChecksPass.php, line 16
Contains Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass.

Namespace

Drupal\Core\DependencyInjection\Compiler
View source
class RegisterAccessChecksPass implements CompilerPassInterface {

  /**
   * Implements CompilerPassInterface::process().
   *
   * Adds services tagged 'access_check' to the access_manager service.
   */
  public function process(ContainerBuilder $container) {
    if (!$container
      ->hasDefinition('access_manager')) {
      return;
    }
    $access_manager = $container
      ->getDefinition('access_manager');
    foreach ($container
      ->findTaggedServiceIds('access_check') as $id => $attributes) {
      $access_manager
        ->addMethodCall('addCheckService', array(
        $id,
      ));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RegisterAccessChecksPass::process public function Implements CompilerPassInterface::process(). Overrides CompilerPassInterface::process