You are here

function private_get_default in Private 7.2

Apply default private settings to node based on the content type.

3 calls to private_get_default()
private_form_alter in ./private.module
Implements hook_form_alter().
private_node_insert in ./private.module
Implements hook_node_insert().
private_node_load in ./private.module
Implements hook_node_load().

File

./private.module, line 413
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_get_default($node) {
  if (!isset($node->private)) {
    $typeSetting = variable_get('private_' . $node->type, PRIVATE_ALLOWED);
    $node->private = $typeSetting == PRIVATE_ALWAYS || $typeSetting == PRIVATE_AUTOMATIC;
    $node->privateLocked = $typeSetting == PRIVATE_ALWAYS || $typeSetting == PRIVATE_DISABLED;
  }
}