domain_content_filter_operations(&$operations)Filters the node batch operations based on the user's permissions.
&$operations The complete list of operations, passed by reference.
No return value. Modify by reference.
domain_content/domain_content.admin.inc, line 310
<?php
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 nodes')) {
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']);
}
}
?>