I have a custom module which implements hook_node_view()
and checks certain conditions to decide whether a user can view the content or not. The code snippet is:
if( ! user_is_logged_in() && $node->type == "abc") { drupal_access_denied(); module_invoke_all('exit'); exit(); } else { //do nothing } }
The code works fine for me but the problem occurs when drupal's cron runs as Anonymous
user. The only message I get is Attempting to re-run cron while it is already running.
Could you please give me your suggestion to handle this.