You are here

function acl_node_clear_acls in ACL 8

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

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

1 call to acl_node_clear_acls()
AclTest::testNodeAclAddRemoveFromNode in src/Tests/AclTest.php
Includes acl_node_add_acl, acl_node_remove_acl, acl_node_clear_acls

File

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

Code

function acl_node_clear_acls($nid, $module) {
  $database = \Drupal::database();
  $select = $database
    ->select('acl', 'a')
    ->fields('a', [
    'acl_id',
  ])
    ->condition('a.module', $module);
  $database
    ->delete('acl_node')
    ->condition('nid', $nid)
    ->condition('acl_id', $select, 'IN')
    ->execute();
}