You are here

function antispam_access_callback in AntiSpam 7

Same name and namespace in other branches
  1. 6 antispam.module \antispam_access_callback()
1 string reference to 'antispam_access_callback'
antispam_menu in ./antispam.module
Implements hook_menu().

File

./antispam.module, line 584
Primary hook implementations for the Antispam module.

Code

function antispam_access_callback($callback, $content_type, $object, $op) {
  if ($content_type == 'node' && !node_access('update', $object)) {
    return FALSE;
  }
  $content_id = '';
  if ($content_type == 'node') {
    $content_id = $object->nid;
  }
  elseif ($content_type == 'comment') {
    $content_id = $object->cid;
  }
  if (function_exists($callback && !antispam_is_spam_moderator(antispam_content_get_moderator_type($content_type, $content_id)))) {
    return FALSE;
  }

  // Is there a comment access check we need to run? If yes, then do the same
  // as above.
  return TRUE;
}