You are here

function commerce_payment_transaction_access in Commerce Core 7

Determines access for a variety of operations on payment transactions.

Parameters

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

$transaction: The payment transaction to check.

$account: The user account attempting the operation; defaults to the current user.

Return value

TRUE or FALSE indicating access for the operation.

2 calls to commerce_payment_transaction_access()
commerce_payment_handler_field_payment_transaction_link_delete::render in modules/payment/includes/views/handlers/commerce_payment_handler_field_payment_transaction_link_delete.inc
Render the field.
commerce_payment_ui_payment_transaction_uri in modules/payment/commerce_payment_ui.module
Entity uri callback: points to the admin view page of the given payment transaction.
3 string references to 'commerce_payment_transaction_access'
commerce_payment_entity_info in modules/payment/commerce_payment.module
Implements of hook_entity_info().
commerce_payment_ui_menu in modules/payment/commerce_payment_ui.module
Implements hook_menu().
commerce_payment_views_data in modules/payment/includes/views/commerce_payment.views.inc
Implements hook_views_data()

File

modules/payment/commerce_payment.module, line 959
Defines the payment system and checkout integration.

Code

function commerce_payment_transaction_access($op, $transaction, $account = NULL) {
  if (isset($transaction->order_id)) {
    $order = commerce_order_load($transaction->order_id);
    if (!$order) {
      return FALSE;
    }
  }
  else {
    $order = NULL;
  }
  return commerce_payment_transaction_order_access($op, $order, $account);
}