Hi,

I'm using revisioning with workflow. I followed this tutorial to configure the permissions of my roles. In workflow, anonymous users can't see content in "draft" (workflow) state.

When I have a published content, which was updated by the author and created a "pending/draft" (revisioning) revision at a "draft" (workflow) state, the "current/published" revision is still published, and all that are OK!

The problem is that :
anonymous users can view published content + anonymous users can't view "draft" (workflow) state = anonymous users can't see "draft" (workflow) state even if it's published.

What can i configure to make the user see the current/published version of the content ?

I always can make the anonymous users can view "draft" (workflow) state but he will see all "drafts" content, even unpublished :(.

Comments

Status:Active» Closed (works as designed)

It surely depends on "the anonymous user can see content revision ". [turning it off for anonymous]

Adding anonymous to "roles that can see the content in this state" in draft with workflow.

Then when there is a current/published version, and the anonymous user can't see content revision (pending/draft), he will see the published one. :)

But when we unpublish the content, the anonymous user can still see the unpublished content :(.

Status:Closed (works as designed)» Active

back to active wrong change!

Title:Anonymous users can't see current/published contentRevisioning + Workflow D7: anonymous users can't see current/published content

Hi,
That tutorial is actually for Revisioning and Workflow in D6. Workflow D7 came out fairly recently and I have not tried that combo myself yet, but am glad you're taking it for a spin!
Can I confirm that you are using Revisioining 7.x-1.3 and Workflow 7.x-1.0 ? Or are you using dev versions?
Rik

Hi RdeBoer,

Thanks for your answer, I tryed these configuration on both stable end dev version... I think It is a normal behavior for the two modules. What I've done to get arround this situation is :

  • I've created a new workflow state named "updated_draft" which can be visible to anonymous users
  • And with rules module, I created a rule that change the workflow state to "draft" (unvisible to anomymous users) when the node is unpublished
  • And one another to bring the state back when the node is republished

The feature that can be added to that is the possibility for workflow to manage a revision state separately than just a node state.

Wish you understand what I mean.

Cheers, Jonathan.

Status:Active» Closed (cannot reproduce)

Revisioning 7.x-1.x-dev and Workflow have changed considerably since this issue was raised.
Please re-open if the issue still exists with the latest versions of these modules.
Rik

I seem to be having a similar issue. Not sure if this is and issue with Revisioning or Workflow, but since I found this issue I'll post it here. When I first create a node in the draft state, it is immediately viewable by anonymous users. I initially experienced this problem on a site I've upgraded from D6 to D7. I set up a clean site to do further testing:

drupal 7.22
revisioning 7.x-1.4+36-dev
workflow, workflow_access and workflow_admin_ui 7.x-1.1+6-dev

I set up revisioning and workflow according to http://drupal.org/node/408968 and http://drupal.org/node/408052. I didn't want to complicate things, so I skipped views and rules. I simply set the revisioning options on Basic page, set up the roles with appropriate permissions and configured workflow with 3 states and appropriate access, transitions, etc. If you are unable to replicate my problem, I will elaborate on the exact settings that I ended up with.

If you then create a basic page (I tested as and Author role as well as User 1) in the draft state, the page is unpublished and the revision is pending. If you then log out, you can view the page as an anonymous user.

Status:Closed (cannot reproduce)» Active

I'll give it a shot...

Version:7.x-1.3» 7.x-1.x-dev
Assigned:Unassigned» RdeBoer

I have reproduced the problem with the setup mentioned in #6 of this thread, which includes Revisioning, Workflow and Workflow Access.
I have also reproduced the problem with just Workflow and Workflow Access (no Revisioning).

The problem really is this: Workflow Access implements hook_node_grants(), but it does NOT implement hook_node_access().

The Workflow Access implementation of hook_node_grants() does not consider the published status of the node. It looks at the workflow state access rights only... and that is probably the correct thing to do. However it also does not implement hook_node_access(), which is where it could consider paying some attention to the published flag when the accessing user is the anonymous user.

One way to fix this would be for Workflow Access to implement hook_node_access(). The function takes precedence over hook_node_grants() and could deny access to anonymous users trying to view content that isn't published yet.

For now, though I've handled this in Revisioning's implementation of hook_node_access() as follows:

  // Deny access to unpublished, moderated content by anonymous users.
  if (empty($node->status) && !empty($node->revision_moderation) && empty($account->uid)) {
    return NODE_ACCESS_DENY;
  }

That should fix the immediate problem. Let's run with this for while in 7.x-1.x-dev and see how people like it.

To be perfectly clear: when used with Revisioning give both anonymous and authenticated users View access to ALL 3 workflow states: in draft, in review and live.

For further detials see the comments in the code above function node_access() in the node.module

Status:Active» Fixed

Check versions dated 11 Apr 2013 or later.

@rdeboer this is great. I tested your fix on both my clean test site and my D6 to D7 upgraded site and everything works as expected. Node status is now considered and nodes don't appear for anonymous users until they are transitioned to the live state. They are also appropriately hidden when you unpublish a node with revisioning's unpublish link (this was not working previously). Thanks again for all your work on this module!

Great then we're all good with the latest dev.

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

Correcting orthograph errors... :)