You are here

function _oauth2_client_test_grant_permissions in OAuth2 Client 7

Same name and namespace in other branches
  1. 8 tests/oauth2_client_test/oauth2_client_test.install \_oauth2_client_test_grant_permissions()
  2. 7.2 tests/oauth2_client_test.install \_oauth2_client_test_grant_permissions()
1 call to _oauth2_client_test_grant_permissions()
oauth2_client_test_enable in tests/oauth2_client_test.install
Implements hook_enable().

File

tests/oauth2_client_test.install, line 146
Enable and disable hook functions.

Code

function _oauth2_client_test_grant_permissions() {

  // Make sure that users have the permission to use the oauth2 server.
  foreach (array(
    'anonymous user',
    'authenticated user',
  ) as $role_name) {
    $role = user_role_load_by_name($role_name);
    user_role_grant_permissions($role->rid, array(
      'use oauth2 server',
    ));
  }
}