function _services_menu_access in Services Menu 7
Access callback for the menu resource.
Parameters
$op: The operation that's going to be performed.
$args: The arguments that will be passed to the callback.
Return value
bool Whether access is given or not.
1 string reference to '_services_menu_access'
- services_menu_services_resources in ./
services_menu.module - Implements hook_services_resources().
File
- ./
services_menu.module, line 56
Code
function _services_menu_access($op = 'view', $args = array()) {
global $user;
$access = FALSE;
switch ($op) {
case 'view':
$access = user_access("services menu retrieve menu");
if (!in_array($args[0], menu_get_names())) {
return services_error(t('Menu @menu_name could not be found', array(
'@menu_name' => $args[0],
)), 404);
}
break;
}
return $access;
}