You are here

function uc_order_can_view_order in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_order/uc_order.module \uc_order_can_view_order()

Access callback for user/%user/orders*.

1 string reference to 'uc_order_can_view_order'
uc_order_menu in uc_order/uc_order.module
Implements hook_menu().

File

uc_order/uc_order.module, line 551

Code

function uc_order_can_view_order($order_user, $order = NULL) {
  global $user;
  $access = user_access('view all orders') || $user->uid && user_access('view own orders') && $user->uid == $order_user->uid;
  if (!is_null($order)) {
    $access = $access && $order_user->uid == $order->uid;
  }
  return $access;
}