You are here

function uc_order_order_product_access in Ubercart 7.3

Entity API "access callback" for uc_order_product entity.

Checks order product access for various operations.

Parameters

$op: The operation being performed. One of 'view', 'update', 'create' or 'delete'.

$order: Optionally an order to check access for.

$account: The user to check for. Leave it to NULL to check for the current user.

1 string reference to 'uc_order_order_product_access'
uc_order_entity_info in uc_order/uc_order.module
Implements hook_entity_info().

File

uc_order/uc_order.module, line 1082

Code

function uc_order_order_product_access($op, $product = NULL, $account = NULL) {
  if (isset($product) && $product->order_id) {
    $order = uc_order_load($product->order_id);
    return uc_order_order_entity_access($op, $order, $account);
  }
  return FALSE;
}