From a6609017ed88b0aac95ce0c7f078ee023a48709f Mon Sep 17 00:00:00 2001 From: Steve Worley Date: Wed, 28 Jul 2021 17:12:59 +1000 Subject: [PATCH] Add token check to tab removal. Access headers. --- quant.module | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quant.module b/quant.module index 495238ef..ae36e088 100644 --- a/quant.module +++ b/quant.module @@ -22,6 +22,10 @@ use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; * Implements hook_menu_local_tasks_alter(). */ function quant_menu_local_tasks_alter(&$data, $route_name) { + if (!\Drupal::requestStack()->getCurrentRequest()->headers->get('quant-token')) { + return; + } + if (\Drupal::currentUser()->isAnonymous()) { unset($data['tabs']); }