I have previously created a view to search my different content types and it behaves like I want it to.
Now, I would like to limit the search results based on a user profile field. Each content type has an access level field. The access fields are tiered as follows:
A: every one can see it B: only authenticated users can see it C: only authenticated users with a certain profile property can see it
C users can see everything. B users can see B and A content.
My first attempt at this was using a contextual filter and this sort of works. However, it only returns nodes that match the access tier.
I did this with PHP contextual filter code:
$memberAccessLevel = 'Public';
if (!empty($argument->field_membership['und'][0]['value'])) {
$memberAccessLevel = $argument->field_membership['und'][0]['value'];
}
return $memberAccessLevel;
My question is, how can I set up the view so that tier C members can see all content?