You are here

function content_access_delete_per_node_settings in Content Access 6

Same name and namespace in other branches
  1. 8 content_access.module \content_access_delete_per_node_settings()
  2. 7 content_access.module \content_access_delete_per_node_settings()

Deletes all custom per node settings, so that content type defaults are used again.

2 calls to content_access_delete_per_node_settings()
content_access_action_reset_node_permissions in ./content_access.rules.inc
Action implementation: Reset permissions for a node.
content_access_page_reset in ./content_access.admin.inc

File

./content_access.module, line 405
Content access module file.

Code

function content_access_delete_per_node_settings($node) {
  db_query("DELETE FROM {content_access} WHERE nid = %d", $node->nid);

  // Clear the cache.
  content_access_per_node_setting(NULL, $node, FALSE);

  // Delete possible acl settings
  if (module_exists('acl')) {
    foreach (array(
      'view',
      'update',
      'delete',
    ) as $op) {
      $acl_id = content_access_get_acl_id($node, $op);
      acl_delete_acl($acl_id);
    }
  }
}