You are here

function notifications_content_node_allow in Notifications 6.4

Same name and namespace in other branches
  1. 5 notifications_content/notifications_content.module \notifications_content_node_allow()
  2. 6 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.

File

notifications_content/notifications_content.module, line 955
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];
}