You are here

function classified_node_access in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 classified.module \classified_node_access()

Implements hook_node_access().

File

./classified.module, line 1305
A pure D7 classified ads module inspired by the ed_classified module.

Code

function classified_node_access($node, $op, $account) {

  // $node->type on $op == create, $node otherwise.
  $type = is_string($node) ? $node : $node->type;

  // Ads admin bypasses checks.
  if ($type == 'classified' && user_access('administer classified ads', $account)) {
    $ret = NODE_ACCESS_ALLOW;
  }
  else {
    $ret = NODE_ACCESS_IGNORE;
  }
  return $ret;
}