You are here

function search_api_test_node_grants in Search API 8

Implement hook_node_grants().

File

tests/search_api_test/search_api_test.module, line 16
Provides a fake search server and other help for testing purposes.

Code

function search_api_test_node_grants(AccountInterface $account, $op) {
  $grants = [];
  if (\Drupal::state()
    ->get('search_api_test_add_node_access_grant', FALSE)) {
    $grants['search_api_test'] = [
      $account
        ->id(),
    ];
  }
  return $grants;
}