0

I have a "Editor" Role with limited access rights. It can basically only create blog type nodes.

I'd like to expose to them the possibility to make to publish the node to the frontpage via the drupal core "publish to startpage" Promotion Option.

By which permission is this controlled? I tried all the node ones, but could not find it.

1 Answer 1

0

It turned out this is controled by the administer content permission. It has security implications, as it also exposes the ability to change the author and creation time of the node.

If you don't what that, you'd need to use the form_alter hook to dissable the athor and creation time field for the Editor role.

For example:

function MY_MODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  if (in_array('editor', Drupal::currentUser()->getRoles(), true)) {

    switch ($form_id) {
      case 'node_blog_edit_form':
      case 'node_blog_form':
         $form['author']['#access'] = false;
         break;
    }

  }
}

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.