Create block user flag, hide users from view I have created a social site where users can flag other users as "blocked". The primary view for the site lists users along with a bit of profile2 data and a "block" flag link. Users cannot see themselves in the view.

What relationships and filter criteria do I need to add to hide blocked users from the view on a per-user basis?

Example use case: 4 users, User A blocks User C

User A's view:


User B
User C (message about how you blocked them)
User D


User B's view:


User A
User C
User D


User C's view:


User B
User D


User D's view:


User A
User B
User C
I couldn't find a way to do this within Views, despite the seemingly simple task and the various decent explanations found around the internet (nit3ch's comment included). The explanations limited the view results too much or in the wrong way. 

I ended up using a Views PHP filter field to perform the filtering task:

global $user;
$flags = flag_get_user_flags('user', NULL, $row-&gt;uid);
if( array_key_exists('block', $flags) &amp;&amp; array_key_exists($user-&gt;uid, $flags['block'])){
    //dsm($row); // optional debug
    return TRUE; // prevents row from being displayed
}