Users without publish access should not be allowed to create published content

Created on 21 June 2023, over 1 year ago

Problem/Motivation

Currently, even if a user does not have publish access on a content type, they can create published content. I believe content created by those users should be unpublished by default.

Steps to reproduce

1. Set the Article content type to be Published by default
2. Create a role that can create articles
3. DO NOT give that role publish permission for articles
4. The user will create published articles by default

Proposed resolution

Set the default value for Published to FALSE when the user does not have publish permissions.

📌 Task
Status

Active

Version

1.0

Component

User interface

Created by

🇷🇴Romania stefan.butura

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @stefan.butura
  • 🇮🇳India vinaysamant Kudal, Maharashtra

    i was struggling a lot to get this module configured as my expectations that were close to your's.
    I wonder why is this not inbuilt in Drupal even after 10. They have some monster like Content Moderation & Workflows but not something very basic like "publish content". anyways..

    In this, i think major issue is with documentation of module : "After enabling it, you first need to choose the content types this will work with. Goto Structure -> Content Types then edit each that should work with this module. Tick the "Enable publish content" tickbox under the publishing options and save.". This is totally missing.

    Module has independent setting under Workflows menu "Publish Content" submenu. There is an option "Publish and unpublish via checkbox" which is uncheck by default. But if you enable this then it sorts everything. Additional option to set "status" appear on content creation form. In Content Type setting's keep option of "Published" unchecked. So by default content is unpublished. For every user. But when user has "Publish Content" permission, "status" can be set. Otherwise this option is visible but disabled. This is really useful, mainly w/o using any patch or making any programming changed. Unfortunately it's not properly documented.

  • 🇪🇸Spain rodrigoaguilera Barcelona

    Please feel free to propose changes to the documentation. If the community agrees on the changes I pledge to review and merge them.

    I don't dedicate much time to this module anymore but I try to pay attention to the MRs that are affecting a lot of folks.

  • 🇮🇳India vinaysamant Kudal, Maharashtra

    where should i write the documentation? Can i write it here in my next comment?

    Also i have a small feature request, if you can spare some time and help.. plz where should i post it?

  • 🇪🇸Spain rodrigoaguilera Barcelona

    Hello Vinay

    You can open an issue for that.

    Take the text from https://www.drupal.org/project/publishcontent
    and turn it in to Markdown for a readme.md file for the root of the repo. That should be one commit.
    Then in successive commits you can improve that description/docs for easier review.
    You should open a MR with your commits.

    Once the changes have been approved by the community I can take care of using that readme.md file for updating the main page description of the module.

Production build 0.71.5 2024