I'm trying to grant access to un/publish own node types to a specific role.
There is no problem with publish. So that user can publish his own node type.
In permissions if I select "unpublish any node type" or "Unpublish any content" then user sees the unpublish button either in his own node and all the other published nodes as well. Without this I couldn't set up so that user just see the unpublish button only on his own node type.

CommentFileSizeAuthor
#5 2952858-5.patch2.54 KBfran seva

Comments

saleh-tavassoli created an issue. See original summary.

saleh-tavassoli’s picture

Assigned: saleh-tavassoli » Unassigned
DrupalRanger’s picture

I am also having this same issue. In addition, it seems the Drupal website for this post has the issue as well. I can View and Edit this original post when logged in. I should be only able to comment. This is a major bug that makes the module un-usable for its purpose. However, this could be a core issue somehow unless this site is also using this module.

I noticed this from the setup: 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.

I do not have this option.

Drupal 8.5.5
Publish Content: 8.x-1.0

DrupalRanger’s picture

I have fixed my issue. It was not a module problem but rather a lack of proper configuration and setup documentation. Please consider adding the following to the module page as the setup process is NOT the same for D7 and D8.

Drupal 8
To give roles permission to publish and unpublish content the "Administer Content" box under the "Node" section of permissions MUST be on for each role you want to use this module with. You then control the more granular permissions under the "Publish Content" permissions section for each node type. NO configuration settings are found under Structure --> Content Types -->Content Type Edit Page -->Publishing Options like in D7.

fran seva’s picture

Status: Active » Needs review
StatusFileSize
new2.54 KB

Hi - I think there are 2 errors in the code:

* The access callback to check the owner is the user the following code is being used:
$this->node->getOwner() == $this->account->id())

To make the comparison works we need to use $this->node->getOwner()->Id()

* The access callback to check if the user has permission to edit it is checking "edit" operation but I think the correct operation name is "update"

fran seva’s picture

Sorry here, I pushed a really wrong patch.

fran seva’s picture

Assigned: Unassigned » fran seva
Status: Needs review » Needs work
tjtj’s picture

DrupalRanger: This seems very dangerous to me. There is lots of content I do not want users to administer.

DrupalRanger’s picture

tjtj: I agree that the setup makes it easy to misconfigure a role for a specific content type and give them the ability to do something they should not have the ability to do. Thus, with this module, you must be diligent. Proper documentation should help with this.

However: With this module, you have the ability to limit roles to publish any node type, publish editable node type, publish own node type, unpublish any node type, unpublish editable node type, unpublish own node type.
With users I go with Own Node Type, With Editors I go with editable node type.

Am I missing a layer of permissions that I don't realize? Does this open a users ability to administer content and bypass this modules permission settings?

hudri’s picture

@Drupal Ranger: This is very dangerous, don't do it. "Administer content" also allows to change the owner of the node. With this setting those user roles can bypass all permissions on EVERY node.

frankdesign’s picture

Hi

I have this issue as well, although in my case, neither publish own node type or unpublish own node type are working.

And like @hudri suggests, I don't want to give the specific role access to Administer content.

Is there a working solution?

Using Drupal 8.6.1 and Publish Content 8.x-1.0

F

madanl’s picture

There should be option in the permission list to give a specific role access to allow only to publish/unpublish own node/content.