You are here

function acl_node_clear_acls in ACL 7

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

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

1 call to acl_node_clear_acls()
AclWebTestCase::testNodeAclAddRemoveFromNode in tests/acl.test
Includes acl_node_add_acl, acl_node_remove_acl, acl_node_clear_acls

File

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

Code

function acl_node_clear_acls($nid, $module) {
  $select = db_select('acl', 'a')
    ->fields('a', array(
    'acl_id',
  ))
    ->condition('a.module', $module);
  db_delete('acl_node')
    ->condition('nid', $nid)
    ->condition('acl_id', $select, 'IN')
    ->execute();
}