You are here

protected function TeamMemberApiProductAccessHandler::processAccessHookResults in Apigee Edge 8

We grant access to the entity if all conditions are met.

Conditions:

  • No modules say to deny access.
  • At least one module says to grant access.

Parameters

\Drupal\Core\Access\AccessResultInterface[] $access: An array of access results of the fired access hook.

Return value

\Drupal\Core\Access\AccessResultInterface The combined result of the various access checks' results. All their cacheability metadata is merged as well.

See also

\Drupal\Core\Access\AccessResultInterface::orIf()

1 call to TeamMemberApiProductAccessHandler::processAccessHookResults()
TeamMemberApiProductAccessHandler::access in modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php
Checks access to an operation on a given API product.

File

modules/apigee_edge_teams/src/TeamMemberApiProductAccessHandler.php, line 190

Class

TeamMemberApiProductAccessHandler
Default team member API product access handler implementation.

Namespace

Drupal\apigee_edge_teams

Code

protected function processAccessHookResults(array $access) : AccessResultInterface {

  // No results means no opinion.
  if (empty($access)) {
    return AccessResult::neutral();
  }

  /** @var \Drupal\Core\Access\AccessResultInterface $result */
  $result = array_shift($access);
  foreach ($access as $other) {
    $result = $result
      ->orIf($other);
  }
  return $result;
}