menu_node_edit_user_node_types

Versions
menu_node_edit
menu_node_edit_user_node_types($account = NULL)

Get the node types that this user can edit.

Parameters

$account The user account being checked (optional).

Return value

An array of node types.

Code

./menu_node_edit.module, line 685

<?php
function menu_node_edit_user_node_types($account = NULL) {
  $allowed = array();
  $types = node_get_types();
  foreach ($types as $type => $value) {
    if (user_access('administer nodes', $account) || user_access('edit all '. $type .' content in assigned sections', $account) || user_access('edit any '. $type .' content', $account)) {
      $allowed[] = $type;
    }
  }
  // Blogs are a goofy case.
  if (array_key_exists('blog', $types) && !in_array('blog', $allowed) && user_access('edit any blog entry', $account)) {
    $allowed[] = 'blog';
  }
  return $allowed;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List