You are here

function merci_reservation_access in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Access callback for Task.

1 string reference to 'merci_reservation_access'
merci_reservation_entity_info in merci_reservation/merci_reservation.module
Implements hook_entity_info().

File

merci_reservation/merci_reservation.module, line 359

Code

function merci_reservation_access($op, $merci_reservation, $account = NULL, $entity_type = NULL) {
  global $user;
  if (!isset($account)) {
    $account = $user;
  }
  switch ($op) {
    case 'delete':
      return user_access('delete any merci_reservation entities') || user_access('delete own merci_reservation entities') && $merci_reservation->uid == $account->uid;
    case 'create':
      return user_access('create merci_reservation entities', $account);
    case 'view':
      return user_access('view merci_reservation entities', $account);
    case 'edit':
      return user_access('edit any merci_reservation entities') || user_access('edit own merci_reservation entities') && $merci_reservation->uid == $account->uid;
  }
}