You are here

function private_node_update in Private 7

Same name and namespace in other branches
  1. 7.2 private.module \private_node_update()

Implements hook_node_update().

1 call to private_node_update()
private_node_insert in ./private.module
Implements hook_node_insert().

File

./private.module, line 243
A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.

Code

function private_node_update($node) {
  if (isset($node->private)) {
    db_merge('private')
      ->key(array(
      'nid' => $node->nid,
    ))
      ->fields(array(
      'nid' => $node->nid,
      'private' => (int) $node->private,
    ))
      ->execute();
  }
}