Skip to content

Commit

Permalink
Only alter AccessResult if both revision & token are present.
Browse files Browse the repository at this point in the history
  • Loading branch information
stooit committed Nov 1, 2023
1 parent 912ae09 commit cccba88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion quant.module
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ function quant_shutdown(array $context = []) {
function quant_node_access(NodeInterface $node, $op, AccountInterface $account) {
$request = \Drupal::request();

if (!$request->headers->has('quant-revision') && !$request->headers->has('quant-token')) {
// Both revision & token headers need to be present to alter access.
if (!$request->headers->has('quant-revision') || !$request->headers->has('quant-token')) {
return AccessResult::neutral();
}

Expand Down

0 comments on commit cccba88

Please sign in to comment.