function DenyAdminRoutes::check

Same name in other branches
  1. 9 core/modules/dynamic_page_cache/src/PageCache/ResponsePolicy/DenyAdminRoutes.php \Drupal\dynamic_page_cache\PageCache\ResponsePolicy\DenyAdminRoutes::check()
  2. 8.9.x core/modules/dynamic_page_cache/src/PageCache/ResponsePolicy/DenyAdminRoutes.php \Drupal\dynamic_page_cache\PageCache\ResponsePolicy\DenyAdminRoutes::check()
  3. 10 core/modules/dynamic_page_cache/src/PageCache/ResponsePolicy/DenyAdminRoutes.php \Drupal\dynamic_page_cache\PageCache\ResponsePolicy\DenyAdminRoutes::check()

Overrides ResponsePolicyInterface::check

File

core/modules/dynamic_page_cache/src/PageCache/ResponsePolicy/DenyAdminRoutes.php, line 39

Class

DenyAdminRoutes
Cache policy for routes with the '_admin_route' option set.

Namespace

Drupal\dynamic_page_cache\PageCache\ResponsePolicy

Code

public function check(Response $response, Request $request) {
    if (($route = $this->routeMatch
        ->getRouteObject()) && $route->getOption('_admin_route')) {
        return static::DENY;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.