title: How to restrict access to certain routes in Phoenix?
body: <p>I have a small Phoenix application allowing users to login and consult their profile. I used the following simple route:</p>
  
  <pre><code>resources "/users", MyApp.UserController
  </code></pre>
  
  <p>But this allows every user to see the list of users via the <code>:index</code> action, as well as delete or update any user.</p>
  
  <p>What is the easiest way to restrict access to admins only? Should I add a check in front of every action? Or should I create a <code>"/admin"</code> resource which would handle those operations? What is the recommended way?</p>