In Drupal 6, I would like the "administer>content management" menu to not include the "post-settings" item for a role while still displaying other items on the administer navigation menu.

Is there a way to configure this? It does not appear as a distinct user permission setting.

Any help would be appreciated. Thanks,

Izzy

Comments

vm’s picture

Component: node system » menu system
Status: Active » Fixed

investigate modules like menu_access.module. Follow up on this question is better suited in the forums.

izmeez’s picture

Thanks for the reply. Is there some way I can move this discussion to the forums?

I see that Drupal 7 is looking to move the items away from the post settings page. I was wondering if there is a simple way to control access to it on the administer menu for Drupal 6. I have been reluctant to use other node access programs since I am experimenting with OG, but maybe menu access will be okay. I have just taken a look at the menu_access module page and I will explore it further.

Thanks,

Izzy

vm’s picture

there is no way to move an issue to the forums, sorry.
I'd test the module in a test environment of my production site prior to deploying in the event that you are reluctant.
There is no way that I can find to restrict of give access to menu items in core. Unless I am missing something glaring (it's happened before).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mairav’s picture

Title: Post-settings, how to restrict user permissions to this menu item » Post-settings hidden from admin menu based on user permissions

@izmeez I was facing the same problem as you. I don't want the "Post settings" item shown in the admin menu for certain roles, so I digg in node module and adit two lines of code that made what I want.

Open the node.module file placed in modules/node
In the following code I added the bold part (line 1121 more or less):

/**
 * Implementation of hook_perm().
 */
function node_perm() {
  $perms = array('administer content types', 'administer nodes', <b>'administer post settings', </b>'access content', 'view revisions', 'revert revisions', 'delete revisions');

  foreach (node_get_types() as $type) {
    if ($type->module == 'node') {
      $name = check_plain($type->type);
      $perms[] = 'create '. $name .' content';
      $perms[] = 'delete own '. $name .' content';
      $perms[] = 'delete any '. $name .' content';
      $perms[] = 'edit own '. $name .' content';
      $perms[] = 'edit any '. $name .' content';
    }
  }

  return $perms;
}

In the line 1429 aprox. I changed the "access arguments text" from "administer nodes" to "administer post settings" and the code block is now like this:

  $items['admin/content/node-settings'] = array(
    'title' => 'Post settings',
    'description' => 'Control posting behavior, such as teaser length, requiring previews before posting, and the number of posts on the front page.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('node_configure'),
    'access arguments' => array('<b>administer post settings</b>'),
    'file' => 'node.admin.inc',
  );

I know we shouldn't touch core modules, but I can't let my customer see this settings. I hope it can help someone.

langworthy’s picture

I solved this by adding the following to a custom site module.

/**
 * Implementation of hook_perm().
 */
function CUSTOM_perm() {
  return array(
    'administer post settings',
  );
}

/**
 * Implementation of hook_menu_alter().
 */
function CUSTOM_menu_alter(&$items) {
  $items['admin/content/node-settings']['access arguments'] = array('administer post settings');

  return $items;
}