You are here

function apigee_edge_teams_test_team_access in Apigee Edge 8

Implements hook_ENTITY_TYPE_access().

File

modules/apigee_edge_teams/tests/modules/apigee_edge_teams_test/apigee_edge_teams_test.module, line 37
Copyright 2018 Google Inc.

Code

function apigee_edge_teams_test_team_access(EntityInterface $entity, $operation, AccountInterface $account) {
  $result = AccessResult::neutral();
  if ($operation === 'view') {
    $result = AccessResult::allowedIf(\Drupal::state()
      ->get(APIGEE_EDGE_TEAMS_TEST_SPECIAL_USERNAME_CAN_VIEW_ANY_TEAM_STATE_KEY, FALSE));
  }
  return $result;
}