function shurly_service_access_api_key in ShURLy 8
Same name and namespace in other branches
- 7 shurly_service/shurly_service.module \shurly_service_access_api_key()
1 string reference to 'shurly_service_access_api_key'
- shurly_service_menu in shurly_service/
shurly_service.module - Implements hook_menu().
File
- shurly_service/
shurly_service.module, line 49 - Link ShURLy functionalities to services module. @todo add option to rate limit requests @todo add option for user api keys
Code
function shurly_service_access_api_key() {
if ($_REQUEST['apiKey']) {
module_load_include('inc', 'shurly_service', 'shurly_api_keys');
$api_validation = is_numeric(shurly_get_uid($_REQUEST['apiKey'])) ? TRUE : FALSE;
}
return \Drupal::currentUser()
->hasPermission('Create short URLs') && $api_validation;
}