title: Authorization with AngularJS
body: <p>We have a single page application with AngularJS (1.6) and a server side running JAVA Spring MVC. After authenticating, the server delivers the index.htm file with a main JS file containing ALL the application's modules.</p>
  
  <p>Now there is a need to make some modules available to certain user roles. What is the accepted way to achieve this?</p>
  
  <p>I was thinking about creating a filter on the server side to catch requests to that JS file and according to the user role, strip down from the JS file the modules which the user shouldn't see.</p>
  
  <p>It seems like not really an elegant solution and I wonder if there is any better way to achieve this.</p>
  
  <p>Thank you!!</p>