You are here

function content_access_delete_per_node_settings in Content Access 7

Same name and namespace in other branches
  1. 8 content_access.module \content_access_delete_per_node_settings()
  2. 6 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/content_access_rules.rules.inc
Action implementation: Reset permissions for a node.
content_access_page_reset in ./content_access.admin.inc
Submit callback for reset on content_access_page().

File

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

Code

function content_access_delete_per_node_settings($node) {
  db_delete('content_access')
    ->condition('nid', $node->nid)
    ->execute();

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

  // Delete possible acl settings
  if (module_exists('acl')) {

    // @todo why content_access.admin.inc is not loaded before?
    module_load_include('inc', 'content_access', 'content_access.admin');
    foreach (array(
      'view',
      'update',
      'delete',
    ) as $op) {
      $acl_id = content_access_get_acl_id($node, $op);
      acl_delete_acl($acl_id);
    }
  }
}