function domain_content_check in Domain Access 6.2
Same name and namespace in other branches
- 5 domain_content/domain_content.module \domain_content_check()
- 7.3 domain_content/domain_content.module \domain_content_check()
- 7.2 domain_content/domain_content.module \domain_content_check()
Access checking routine for menu and node editing checks.
Parameters
$domain_id: An id representing the currently active domain record.
Return value
Boolean true or false.
1 string reference to 'domain_content_check'
- domain_content_menu in domain_content/
domain_content.module - Implement hook_menu()
File
- domain_content/
domain_content.module, line 124 - Editorial overview module.
Code
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;
}
// Otherwise, the user must be able to edit domain nodes.
$rule = user_access('edit domain nodes');
if (!$rule) {
return FALSE;
}
$domains = domain_get_user_domains($user);
$key = $domain_id == 0 ? -1 : $domain_id;
// Can this user see the requested site?
if (!empty($domains[$key])) {
return TRUE;
}
return FALSE;
}