You are here

public function AdminNegotiator::applies in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 70
Contains \Drupal\user\Theme\AdminNegotiator.

Class

AdminNegotiator
Sets the active theme on admin pages.

Namespace

Drupal\user\Theme

Code

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