Skip to content

Commit

Permalink
Add token check to tab removal.
Browse files Browse the repository at this point in the history
Access headers.
  • Loading branch information
steveworley committed Jul 28, 2021
1 parent 2f4c494 commit a660901
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quant.module
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
Expand Down

0 comments on commit a660901

Please sign in to comment.