function domain_content_check in Domain Access 7.3
Same name and namespace in other branches
- 5 domain_content/domain_content.module \domain_content_check()
- 6.2 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 - Implements 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 bypass node access, just return TRUE.
if (user_access('bypass node access') || user_access('review content for all domains')) {
return TRUE;
}
// Otherwise, the user must be able to edit domain content.
$rule = user_access('access the domain content page');
if (!$rule) {
return FALSE;
}
$domains = domain_get_user_domains($user);
// Can this user see the requested site?
if (!empty($domains[$domain_id])) {
return TRUE;
}
return FALSE;
}