4

I've been using Drupal full-time for over six years and I always thought you could use the [content type] create, edit and delete permissions to allow users to create, edit and delete nodes AND use the 'Publishing options', 'Authoring information' etc settings on the node/#/edit page.

Looking at my most recent build today, this is not the case. Additionally, the 'Update options' dropdown and corresponding checkboxes are missing on the admin/content page.

I know there are third party modules like Override Node Options but I'm sure the above was possible.

Additionally, using the 'Administer content' permission is too aggressive because the user can then administer all content types, not just the ones you specify.

Has 'Administer content' permission always been required to expose publishing, authoring etc options? And is there a way around this other than using third-party modules?

1
  • This was poorly implemented by Drupal, IMO, hopefully it was fixed in 8/9 Commented Sep 2, 2021 at 15:33

1 Answer 1

5

This is from node_form() in Drupal 7.0:

$form['author'] = array(
  '#type' => 'fieldset',
  '#access' => user_access('administer nodes'),
  '#title' => t('Authoring information'),
  '#collapsible' => TRUE,
  '#collapsed' => TRUE,
  '#group' => 'additional_settings',
  '#attributes' => array(
    'class' => array('node-form-author'),
  ),
  '#attached' => array(
    'js' => array(
      drupal_get_path('module', 'node') . '/node.js',
      array(
        'type' => 'setting',
        'data' => array('anonymous' => variable_get('anonymous', t('Anonymous'))),
      ),
    ),
  ),
  '#weight' => 90,
);

Note that #access is set to user_access('administer nodes'). The revision and options fields have the same access set. So yes, it's always been required, at least as of Drupal 7.

You don't necessarily need a 3rd party module, but you'll need at least a custom module to make changes. You can implement hook_form_alter() (or hook_form_FORM_ID_alter()) to change the #access key of the desired elements in a few lines of code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.