You are here

function acl_node_clear_acls in ACL 6

Same name and namespace in other branches
  1. 8 acl.module \acl_node_clear_acls()
  2. 5 acl.module \acl_node_clear_acls()
  3. 7 acl.module \acl_node_clear_acls()

Clear all of a module's ACL's from a node.

File

./acl.module, line 95
An API module providing by-user access control lists.

Code

function acl_node_clear_acls($nid, $module) {
  $result = db_query("SELECT acl_id FROM {acl} WHERE module = '%s'", $module);
  while ($o = db_fetch_object($result)) {
    $acls[] = $o->acl_id;
  }
  if ($acls) {
    db_query("DELETE FROM {acl_node} WHERE nid = %d AND acl_id IN (" . db_placeholders($acls) . ")", array_merge(array(
      $nid,
    ), $acls));
  }
}