You are here

function hook_clone_access_alter in Node clone 6

Same name and namespace in other branches
  1. 8 node_clone.api.php \hook_clone_access_alter()
  2. 7 clone.api.php \hook_clone_access_alter()

Alter the access to the ability to clone a given node.

Parameters

bool $access: Reference to the boolean determining if cloning should be allowed on a given node.

$node: The fully loaded node object being considered for cloning.

See also

clone_access_cloning()

drupal_alter()

1 invocation of hook_clone_access_alter()
clone_access_cloning in ./clone.module

File

./clone.api.php, line 40
API documentation for the Node clone module.

Code

function hook_clone_access_alter(&$access, $node) {
  global $user;

  // Only allow cloning of nodes posted to groups you belong to.
  // This function doesn't really exist, but you get the idea...
  if (!og_user_is_member_of_group_the_node_is_in($user, $node)) {
    $access = FALSE;
  }
}