domain_content_check($domain_id)Access checking routine for menu and node editing checks.
$domain_id An id representing the currently active domain record.
domain_content/domain_content.module, line 121
<?php
function domain_content_check($domain_id) {
global $user;
// If the user can administer nodes, just return TRUE.
if (user_access('administer nodes') || user_access('review content for all domains')) {
return TRUE;
}
$rule = user_access('edit domain nodes');
// Otherwise, the user must be able to edit domain nodes.
if (!$rule) {
return FALSE;
}
$domains = domain_get_user_domains($user);
$check = FALSE;
$editor = FALSE;
// Can this user see the default site?
if ($rule && $domain_id == 0 && $domains['-1'] == -1) {
$editor = TRUE;
}
// Can this user see the active site?
else if ($rule && $domain_id > 0 && $domain_id == $domains[$domain_id]) {
$editor = TRUE;
}
if ($editor) {
$check = TRUE;
}
return $check;
}
?>