title: How to protect server views and client views using loopback
body: <p>I'm trying to protect my application's views based on roles. In laravel the solution is simply adding a middleware as part of the route parameters. Also would like to accomplish the same functionality on the client side using an Angular SPA app. Sorry I think these are two questions in one, anyways.</p>
  
  <p><a href="https://laravel.com/docs/5.1/authentication#protecting-routes" rel="nofollow">https://laravel.com/docs/5.1/authentication#protecting-routes</a></p>
  
  <p>Any simple solution to accomplish this? </p>