You are here

function image_access in Image 6

Same name and namespace in other branches
  1. 5.2 image.module \image_access()
  2. 5 image.module \image_access()

Implementation of hook_access().

File

./image.module, line 89

Code

function image_access($op, $node, $account) {
  switch ($op) {
    case 'create':
      if (user_access('create images', $account)) {
        return TRUE;
      }
      break;
    case 'update':
      if (user_access('edit any images', $account) || $account->uid == $node->uid && user_access('edit own images', $account)) {
        return TRUE;
      }
      break;
    case 'delete':
      if (user_access('delete any images', $account) || $account->uid == $node->uid && user_access('delete own images', $account)) {
        return TRUE;
      }
      break;
  }
}