You are here

public function AdminNegotiator::applies in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/src/Theme/AdminNegotiator.php \Drupal\user\Theme\AdminNegotiator::applies()

Whether this theme negotiator should be used to set the theme.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object.

Return value

bool TRUE if this negotiator should be used or FALSE to let other negotiators decide.

Overrides ThemeNegotiatorInterface::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());
}