You are here

function notifications_content_node_allow in Notifications 6

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_node_allow()
  2. 6.4 notifications_content/notifications_content.module \notifications_content_node_allow()
  3. 6.2 notifications_content/notifications_content.module \notifications_content_node_allow()
  4. 6.3 notifications_content/notifications_content.module \notifications_content_node_allow()

Determine whether the specified user may view the specified node.

Does a user switching and checks for node permissions. Looking for a better way but it seems that all the node_access hooks cant be invokes without this.

1 call to notifications_content_node_allow()
notifications_content_notifications in notifications_content/notifications_content.module
Implementation of hook_notifications()

File

notifications_content/notifications_content.module, line 811
Subscriptions to content events

Code

function notifications_content_node_allow($account, $node) {
  static $access;
  if (!$node) {
    return FALSE;
  }
  if (!isset($access[$account->uid][$node->nid])) {
    $access[$account->uid][$node->nid] = node_access('view', $node, $account);
  }
  return $access[$account->uid][$node->nid];
}