There are cases when a role needs to be able to view a piece of content and either approve it or reject it, but without the possibility to edit it. Is this feasible? How could it be implemented?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Issue summary: View changes
juampynr’s picture

Title: Allow a role to moderate but not edit » Allow a role to moderate but not to edit content
Crell’s picture

Assigned: Unassigned » Crell
Status: Active » Needs review
FileSize
6.25 KB

Funny story! In HEAD right now, you cannot moderate content you don't own yourself. That makes it rather pointless. :-)

The fix for that nicely fixes this, too. That is, we add a new permission for viewing all unpublished content, then make the view-latest tab depend on node-view rather than node-edit. Net result, access to the latest-revision tab is now entirely independent of edit permission, which controls the edit tab, and you can moderate content you don't own.

Comes with a new test, too. Let's make sure it all works.

becw’s picture

Lovely, this works fine. It does enable a new UX weirdness, though: users without edit perms can't moderate from published -> other states, because the form is only ever displayed on the "Latest version" tab. I will create a new ticket for that.

becw’s picture

Status: Needs review » Fixed

  • becw committed 6468b3a on 8.x-1.x
    Issue #2652158 by Crell: Allow a role to moderate but not to edit...

Status: Fixed » Closed (fixed)

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

Marishka_’s picture

Status: Closed (fixed) » Active

Reopening issue as this still occurs in beta1 version.

I have setup a workflow with basic states: Draft > Review > Publish
The Approver role should not be able to edit content, but needs to move content from Review > Publish (or from Review > Draft). They cannot do this without the 'ContentType: Edit any content' permission enabled.

juampynr’s picture

This issue introduced a new permission to access to the Latest Version tab: #2672122: Anonymous able to see "View" and "Latest Version" tabs.

By setting the following permissions I am able to allow an authenticated user to moderate but not to edit content:

Permissions

Now, when the moderator user opens the Latest Version tab of a node in Needs Review, it can be moderated. However, if the moderator opens a node in state Needs Review, the "Transition to" form field would show as empty as the role does not have permission to moderate from this state:

Moderate form field empty

Here is a patch that hides the moderation widget when this happens so the moderator can see content in Draft state, but has to wait until it gets to Needs Review in order to moderate it.

josephdpurcell’s picture

Status: Needs review » Fixed

I wasn't able to reproduce this exact issue as described, however I do see the scenario of a user being able to view the "Latest revision" but not able to transition the node to a different state. In that case, yes--this patch does address it.

Thank you!

Status: Fixed » Closed (fixed)

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