function domain_set_default_grant in Domain Access 6.2
Same name and namespace in other branches
- 5 domain.module \domain_set_default_grant()
- 7.3 domain.module \domain_set_default_grant()
- 7.2 domain.module \domain_set_default_grant()
Ensure that the 'domain_all' grant is present.
2 calls to 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.
File
- ./
domain.module, line 1774 - Core module functions for the Domain Access suite.
Code
function domain_set_default_grant() {
static $check = NULL;
if (is_null($check)) {
$check = db_result(db_query("SELECT 1 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);
}
}
}