You are here

function oauth2_server_test_entity_query_alter in OAuth2 Server 7

Implements hook_entity_query_alter().

File

tests/oauth2_server_test.module, line 50
Support module for OAuth2 Server testing.

Code

function oauth2_server_test_entity_query_alter($query) {
  if (!empty($query->tags['oauth2_server_scope_access'])) {
    $server = $query->metaData['oauth2_server'];

    // Nobody should have access to the "forbidden" scope.
    if ($server->name == 'test') {
      $query
        ->propertyCondition('name', 'forbidden', '<>');
    }
  }
}