function AdminNegotiator::applies

Same name in other branches
  1. 9 core/modules/user/src/Theme/AdminNegotiator.php \Drupal\user\Theme\AdminNegotiator::applies()
  2. 8.9.x core/modules/user/src/Theme/AdminNegotiator.php \Drupal\user\Theme\AdminNegotiator::applies()
  3. 11.x core/modules/user/src/Theme/AdminNegotiator.php \Drupal\user\Theme\AdminNegotiator::applies()

File

core/modules/user/src/Theme/AdminNegotiator.php, line 67

Class

AdminNegotiator
Sets the active theme on admin pages.

Namespace

Drupal\user\Theme

Code

public function applies(RouteMatchInterface $route_match) {
    return $this->entityTypeManager
        ->hasHandler('user_role', 'storage') && $this->user
        ->hasPermission('view the administration theme') && $this->adminContext
        ->isAdminRoute($route_match->getRouteObject());
}

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