diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index f2d5376..76cb67c 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -107,6 +107,11 @@ function contextual_help($route_name, RouteMatchInterface $route_match) { * @see \Drupal\contextual\ContextualController::render() */ function contextual_preprocess(&$variables, $hook, $info) { + // No use in adding contextual markup if the user has no access. + if (!\Drupal::currentUser()->hasPermission('access contextual links')) { + return; + } + // Determine the primary theme function argument. if (!empty($info['variables'])) { $keys = array_keys($info['variables']);