function domain_form_permission_check in Domain Access 7.2
Same name and namespace in other branches
- 7.3 domain.module \domain_form_permission_check()
Check a user's permissions for displaying the Domain form on nodes.
This sets the hierarchy of user form permissions for those without 'set domain access'. Note that the most permissive permission wins.
1 call to domain_form_permission_check()
- domain_form_alter in ./
domain.module - Implements hook_form_alter()
File
- ./
domain.module, line 2199 - Core module functions for the Domain Access suite.
Code
function domain_form_permission_check() {
$perms = array(
'publish from default domain' => 1,
'publish from assigned domain' => 2,
'publish to any assigned domain' => 3,
);
// By default, we will hide the form by returning NULL.
$action = NULL;
foreach ($perms as $perm => $value) {
if (user_access($perm)) {
$action = $value;
}
}
return $action;
}