function commerce_invoice_ui_access_by_order in Commerce Invoice 7
Checks invoice access based on order id.
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 'commerce_invoice_ui_access_by_order'
- commerce_invoice_ui_menu in ./
commerce_invoice_ui.module - Implements hook_menu().
File
- ./
commerce_invoice_ui.module, line 150
Code
function commerce_invoice_ui_access_by_order($op, $order = NULL, $account = NULL) {
$invoice = commerce_invoice_load_by_order_id($order->order_id);
if ($invoice) {
return commerce_invoice_access($op, $invoice, $account, 'commerce_invoice');
}
else {
return FALSE;
}
}