function nodeaccess_delete_grants in Nodeaccess 7
Delete all grants from nodeaccess table for this node.
Parameters
$node: node object whose grants are being revoked.
3 calls to nodeaccess_delete_grants()
- nodeaccess_node_delete in ./
nodeaccess.module - Implements hook_node_delete().
- nodeaccess_revoke_grants in ./
nodeaccess.module - Revoke all custom grants from nodeaccess table for this node. Essentially reset the grants to their default state (by node type).
- nodeaccess_set_grants in ./
nodeaccess.module - Set all grants for a node to nodeaccess table and acquire them.
File
- ./
nodeaccess.module, line 1016 - Provide per node access control
Code
function nodeaccess_delete_grants($node) {
try {
db_delete('nodeaccess')
->condition('nid', $node->nid)
->execute();
node_access_acquire_grants($node);
} catch (Exception $e) {
drupal_set_message(t("Database error has occurred while clearing nodeaccess table."), 'error');
watchdog('nodeaccess', 'Database error: @message.', array(
'@message' => $e
->getMessage(),
), WATCHDOG_ERROR);
}
}