function hook_google_api_client_account_scopes_alter in Google API PHP Client 8.4
Same name and namespace in other branches
- 8.3 google_api_client.api.php \hook_google_api_client_account_scopes_alter()
Allows other modules to modify the scope before authentication.
Developers may add or remove scopes, like in this example I remove the gmail metadata scope.
1 invocation of hook_google_api_client_account_scopes_alter()
- GoogleApiClientService::getClient in src/
Service/ GoogleApiClientService.php - Function to retrieve the google client for different operations.
File
- ./
google_api_client.api.php, line 38 - Hooks provided by the Google Api Client module.
Code
function hook_google_api_client_account_scopes_alter(&$scopes, $google_api_client_id) {
if ($google_api_client_id == 1) {
unset($scopes['gmail']['GMAIL_METADATA']);
}
}