Skip to content

Commit

Permalink
Aggregate cacheability information from access results (#1061)
Browse files Browse the repository at this point in the history
Ensure that cacheability information bubbles up from previously evaluated access results instead of just get lost.
  • Loading branch information
mxr576 authored Jul 23, 2024
1 parent e22b578 commit e5569e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/apigee_edge_teams/apigee_edge_teams.module
Original file line number Diff line number Diff line change
Expand Up @@ -261,15 +261,15 @@ function apigee_edge_teams_api_product_access(EntityInterface $entity, $operatio
$team_storage = \Drupal::entityTypeManager()->getStorage('team');
/** @var \Drupal\apigee_edge_teams\Entity\TeamInterface $team */
$teams = $team_storage->loadMultiple($developer_team_ids);
$result = AccessResult::neutral();
foreach ($teams as $team) {
$result = $access_checker->access($entity, $operation, $team, $account, TRUE);
$result = $result->orIf($access_checker->access($entity, $operation, $team, $account, TRUE));
if ($result->isAllowed()) {
break;
}
}
}

// $result is always defined.
return $result;
}

Expand Down

0 comments on commit e5569e8

Please sign in to comment.