title: Node.js + Express.js User Permission Security Model
body: <p>We have an application that has two types of users. Depending on how the user logs in, we want them to have access to different parts of the application.</p>
  
  <p>How do we implement a security model for preventing users from seeing things they do not have access to?</p>
  
  <p>Do we make security part of each routes implementation? The problem being that we will have some duplicate logic across requests. We could move this into helper functions, but we'd still need to remember to call it.</p>
  
  <p>Do we make security part of a global app.all() route handler? The problem being that we have to inspect each route and do different logic based on a multitude of rules. At least all the code is in one place,  but then... all the code is in one place.</p>