I would like a view to include results with content from unpublished nodes for anonymous users. I removed the published filter in my view and the results appear when I access the view as administrator, but it does not appear as an anonymous user. Is there a way to get this to work for anonymous users? I do not want anonymous users to have direct access to the unpublished node, only include field data as part of a view. Thanks!

Comments

nevets’s picture

Under "Advanced" settings under "Other: Query settings" try checking "Disable SQL rewriting "

sgb9809’s picture

Thanks!

leex’s picture

seriously thanks, I wasted a lot of time before finding your comment.

rajiv.singh’s picture

Solved by http://drupal.org/node/1460868#comment-6267822
checking the "Bypass content access control" permission for my editor role.

fedegf’s picture

@rajiv.singh

be aware of the security implications of your solution: editor users will get ALL control for ALL content!

Greetings!

leex’s picture

This works because it bypasses the node_access check, it is the best solution to this problem as it will only affect that particular view.

The solution about changing permissions has many security implications.

jemisond’s picture

I've been pulling my hair out for over an hour trying to get the view to show!

kunalgautam’s picture

Thanks its work for me. :-)

arkjoseph’s picture

This did not work for my application.

Some details are as follows.

Im using a view to display rendered nodes from a node reference (field_select_a_hero). The referenced node contains several fields including an image field, and a collection field. Neither are displaying on the page. The only thing that appears on the page is the node title which is more odd. The node and view are working but for whatever reason, something is causing it to not render any fields.

The purpose is to create an unpublished page for client review thats gated with a login page.

any advice here?

Anonymous’s picture

Have been searching for this for a while, and now it works .. Thank You

matthieu_collet’s picture

thank you, I was looking for that for a long time !!

bien à vous, agence web - brussels
www.bienavous.be

pikadroo’s picture

Well here we are Drupal 8 and this method does not work.

lukey’s picture

I think there's a good reason this does not work in D8. Unpublished content shouldn't be viewable for users w/o permission to view unpublished content.

emb03’s picture

View Any Unpublished content does not work in D8. This is a bug.

pikadroo’s picture

8 years later...