You are here

function farm_api_install in farmOS 7

Same name and namespace in other branches
  1. 2.x modules/core/api/farm_api.install \farm_api_install()

Implements hook_install().

File

modules/farm/farm_api/farm_api.install, line 11
Farm API install file.

Code

function farm_api_install() {

  // Grant oauth2 server permissions to all users.
  // Permission is needed for clients to access the
  // /oauth2/authorize and oauth2/token endpoints anonymously,
  // and as an authenticated user.
  $permissions = array(
    'use oauth2 server',
  );
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, $permissions);
  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, $permissions);

  // Set variable for restws_oauth2_server configuration.
  $server_name = 'farmos_oauth';
  variable_set('restws_oauth2_server_name', $server_name);
}