title: Angular route async authorization
body: <p>Angular doesn't provide any authorization/access permission on routing (I'm talking default Angular route 1.x and not beta 2.0 or UI route). But I do have to implement it.</p>
  
  <p>The problem I'm having is that I have a service that calls server to provide this info and returns a promise. This data however is only obtained once and then cached on the client, but it still needs to be obtained once.</p>
  
  <p>I would now like to handle <code>$routeChangeStart</code> event that checks whether next route defines a particular property <code>authorize: someRole</code>. This handler should then get that data using my previously mentioned service and act accordingly to returned data.</p>
  
  <p>Any ideas beside adding <em>resolves</em> to all my routes? Can I do this centrally somehow? Once for all routes that apply?</p>
  
  <h2>Final solution</h2>
  
  <p>With the help of accepted answer I was able to implement a rather simple and centralized solution that does async authorization. <a href="http://embed.plnkr.co/Xx8qMj/preview" rel="nofollow">Click here</a> to see it in action or check its inner working code.</p>