function commerce_cart_expiration_access in Commerce Cart Expiration 7
Access callback.
1 string reference to 'commerce_cart_expiration_access'
- commerce_cart_expiration_menu in ./
commerce_cart_expiration.module - Implements hook_menu().
File
- ./
commerce_cart_expiration.module, line 66 - Provides a time-based cart expiration feature.
Code
function commerce_cart_expiration_access($op, $arg) {
global $user;
$access = FALSE;
switch ($op) {
case 'ajax_expire':
// We compare the users current cart with the one that may get deleted.
$order_user = commerce_cart_order_load($user->uid);
$access = user_access('administer commerce_order entities') || $arg->order_id == $order_user->order_id && user_access('ajax order expiration');
break;
}
return $access;
}