You are here

function bean_services_access in Bean (for Drupal 7) 7

Access callback for the bean resource.

Parameters

$op: The operation that's going to be performed.

$args: The arguments that will be passed to the callback.

Return value

Whether access is given or not.

1 string reference to 'bean_services_access'
bean_services_resources in ./bean.services.inc
Implements hook_services_resources().

File

./bean.services.inc, line 281
Contains callbacks for service resource manipulation.

Code

function bean_services_access($op, $args) {
  $bean = NULL;
  if (!empty($args[0])) {
    if (is_numeric($args[0])) {
      $bean = bean_load($args[0]);
    }
    else {
      if (is_array($args[1])) {
        $bean = (object) $args[1];
      }
    }
  }
  if (!empty($args[0]) && !is_object($bean)) {
    return FALSE;
  }
  return entity_access($op, 'bean', $bean);
}