Commit e7eedb76 authored by Jonathan Smith's avatar Jonathan Smith
Browse files

Issue #3266795 by jonathan1055: Users' scheduled view uses admin theme even if...

Issue #3266795 by jonathan1055: Users' scheduled view uses admin theme even if permission is restricted
parent 06aec486
Loading
Loading
Loading
Loading
+3 −1
Changes for src/Theme/SchedulerThemeNegotiator.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -24,10 +24,12 @@ class SchedulerThemeNegotiator implements ThemeNegotiatorInterface {
   * {@inheritdoc}
   */
  public function determineActiveTheme(RouteMatchInterface $route_match) {
    // Return the admin theme.
    $config = \Drupal::service('config.factory')->getEditable('system.theme');
    $admin_theme = $config->get('admin');
    // Return the admin theme only if the user has permission to use it.
    if (\Drupal::currentUser()->hasPermission('view the administration theme')) {
      return $admin_theme;
    }
  }

}