public function SubtreeAccess::applies

Declares whether the access check applies to a specific route or not.

Parameters

\Symfony\Component\Routing\Route $route: The route to consider attaching to.

Return value

bool TRUE if the check applies to the passed route, FALSE otherwise.

Overrides AccessCheckInterface::applies

File

drupal/core/modules/toolbar/lib/Drupal/toolbar/Access/SubtreeAccess.php, line 22
Contains \Drupal\toolbar\Access\SubtreeAccess.

Class

SubtreeAccess
Defines a special access checker for the toolbar subtree route.

Namespace

Drupal\toolbar\Access

Code

public function applies(Route $route) {
  return array_key_exists('_access_toolbar_subtree', $route
    ->getRequirements());
}