You are here

function domain_content_filter_operations in Domain Access 6.2

Same name and namespace in other branches
  1. 7.3 domain_content/domain_content.admin.inc \domain_content_filter_operations()
  2. 7.2 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_form in domain_content/domain_content.admin.inc
Rewrites node_admin_nodes() to use db_rewrite_sql().

File

domain_content/domain_content.admin.inc, line 275
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 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']);
  }
}