function domain_content_filter_operations in Domain Access 7.2
Same name and namespace in other branches
- 6.2 domain_content/domain_content.admin.inc \domain_content_filter_operations()
- 7.3 domain_content/domain_content.admin.inc \domain_content_filter_operations()
Filters the node batch operations based on the user's permissions.
Parameters
&$operations: The complete list of operations, passed by reference.
Return value
No return value. Modify by reference.
1 call to domain_content_filter_operations()
- domain_content_admin in domain_content/
domain_content.admin.inc - Content admin page callback.
File
- domain_content/
domain_content.admin.inc, line 444 - Administration pages for Domain Content.
Code
function domain_content_filter_operations(&$operations) {
$settings = variable_get('domain_form_elements', array(
'options',
'delete',
'comment_settings',
'path',
));
// Administer nodes can do anything.
if (user_access('administer nodes')) {
return;
}
// You must be able to edit to view this page, so check for the new delete perm.
if (!user_access('delete domain content')) {
unset($operations['delete']);
}
// The publish, promote and sticky operations all depend on having $settings['options'].
if (!in_array('options', array_filter($settings))) {
unset($operations['publish']);
unset($operations['unpublish']);
unset($operations['promote']);
unset($operations['demote']);
unset($operations['sticky']);
unset($operations['unsticky']);
}
}