_domain_store_grants

Versions
domain
_domain_store_grants($nid, $grants = array())

Store node_access records in the {domain_access} table.

Parameters

$nid The node id being acted upon.

$grants The grants passed by hook_node_access_records().

Code

./domain.module, line 1446

<?php
function _domain_store_grants($nid, $grants = array()) {
  if ($nid > 0 && !empty($grants)) {
    db_query("DELETE FROM {domain_access} WHERE nid = %d", $nid);
    foreach ($grants as $grant) {
      db_query("INSERT INTO {domain_access} (nid, gid, realm) VALUES (%d, %d, '%s')", $nid, $grant['gid'], $grant['realm']);
    }
  }
  // Ensure that our default grant is present.
  domain_set_default_grant();
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List