domain_set_default_grant

Versions
domain
domain_set_default_grant()

Ensure that the 'domain_all' grant is present.

▾ 2 functions call domain_set_default_grant()

domain_enable in ./domain.module
Upon enabling this module, store the default view grant in the {node_access} table. Then it assigns all users to the primary domain.
_domain_store_grants in ./domain.module
Store node_access records in the {domain_access} table.

Code

./domain.module, line 1460

<?php
function domain_set_default_grant() {
  static $check = NULL;
  if (is_null($check)) {
    $check = db_result(db_query("SELECT COUNT(nid) FROM {node_access} WHERE realm = '%s' AND gid = %d", 'domain_all', 0));
    if ($check == 0) {
      db_query("INSERT INTO {node_access} (nid, gid, realm, grant_view, grant_update, grant_delete) VALUES (%d, %d, '%s', %d, %d, %d)", 0, 0, 'domain_all', 1, 0, 0);
    }
  }
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List