You are here

function private_node_mark_private in Private 7

Same name and namespace in other branches
  1. 6 private.module \private_node_mark_private()

Callback for 'Mark as private' node operation

1 call to private_node_mark_private()
private_set_private_action in ./private.module
Implementation of a Drupal action.
1 string reference to 'private_node_mark_private'
private_node_operations in ./private.module
Implements hook_node_operations().

File

./private.module, line 362
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_mark_private($nids) {
  foreach ($nids as $nid) {
    db_merge('private')
      ->key(array(
      'nid' => $nid,
    ))
      ->fields(array(
      'nid' => $nid,
      'private' => 1,
    ))
      ->execute();
  }
}