Is it possible to have a view that filters out content that the current user doesn't have permission to view?

In my case I want to use the taxonomy term page supplied by views but to not display content in the results that the user does not have permission to see.

Comments

dawehner’s picture

This should be done automatically. There is the node access system which alters the query dynamically. It should take care of the view permissions. Do you have enabled some caching?

What for a kind of node access system do you use?

azoho’s picture

Thanks for reply.
I'm using Node Access
in addition to Content Permissions and Taxonomy Access Control

Eg. I have Blog content types visible only to registered users, but when viewing a taxonomy page, the views override page, Anon users can see the Blog entries in the list (but get access denied when clicking to see full node).

dawehner’s picture

This should be a bug of drupal core. Views does not implement the node access... Thats my oppinion.

azoho’s picture

From my searches on Drupal.org about this I would be inclined to agree with you.

I was wondering if there was a views filter or argument I could use that would act as a workaround, but I guess it will still refer to drupal core in any case

Thanks for your reply

dawehner’s picture

Status: Active » Fixed

There is one in the latest dev version.

merlinofchaos’s picture

One quick note: The 'unpublished' check must be added to the view *if* that is the reason the content is not viewable. Otherwise, it is possible that you may need to rebuild your node access tables, but in general Views respects any node_access because it uses db_rewrite_sql so it should 'just work'.

Status: Fixed » Closed (fixed)

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

louise365’s picture

It seems View does not support filter result by user role or anything like permission.I think next patch of Drupal or View should solve this issue.Sometimes,it's really an important feature.

louise365’s picture

Status: Closed (fixed) » Active
rschwab’s picture

Status: Active » Closed (fixed)

Hi Louise!

I think you are mistaken. See comments #3, 5 and 6. If I am wrong please provide steps to reproduce the problem.