title: How to manage user access and user permissions
body: <p>I am working on an application with PHP + MySql. In my application I have a table for users, a table for relationships (friends, following, subscribed) and a table for posts. The main actions for users are:</p>
  
  <ul>
  <li>A user has friends</li>
  <li>A user can make post entries </li>
  <li>A user can see the friends entries</li>
  <li><strong>And finally</strong> a user can block entries viewing for specific friends</li>
  </ul>
  
  <p>If user A is friends with user B, then user A can see all entries from user B. But user B can restrict access to only a few friends for example. Now the query is: how can I manage these permissions? I was thinking of a table that stores each user that is blocked for viewing an specific entry, but this would't be a good idea once a single user can have several friends. So, how can I solve this? Can someone show me how to start? Maybe the right terms for searching on Google or a link for something similar.</p>