Most of the time this isn't likely to be an issue, because most of the time permissions are dictated purely by your user role.

However, I have a view that relies on OG for its access control and all my users have the same role allocation. This means that when get_cache_key() runs, I really need the node_access tag to have already been added to the query so that when the $query gets built, it includes access checks (and therefore users with different access see different results).

Previously I worked around this issue in a views_query_alter implementation, by modifying $view->build_info, e.g:

$view->build_info['group_id'] = $group_id;

But following on from #1055616: Query arguments should be replaced before generating cache ID, the build_info array is no longer used in it's entirety for building a cache key, so it can no longer be modified in this way.

I can see one option is to turn off access rewriting and instead use the node access filter but I'd really just like to see the node_access tag added to the query before the cache key is generated so that node access checks are included within it.

Comments

MustangGB’s picture

Status: Active » Closed (outdated)

Closing this as outdated, feel free to re-open with updated details if it's still a problem in the latest release.