title: ASP.Net MVC how to determine if a user can access a URL?
body: <p>So I was reading another question regarding login loop when you have a user logging in, set to return to a URL which they might not have access to after logging in (ie. an admin page, and the user logs in with a normal account).</p>
  
  <p>The solution under WebForms seems to be to utilize the <code>UrlAuthorizationModule.CheckUrlAccessForPrincipal</code> method. However that does not work for URLs going to Action Methods secured with the Authorize Attribute. I figured I could work out which method the URL was pointing at and reflect over it to solve my problem - but I can't seem to work out how I get this information out of the routing table.</p>
  
  <p>Anyone ever worked with this, or have a solution for this? If I can just get hold of the route information from a URL I think I could work the rest out, but if anyone has a generic solution - ie. some hidden method akin to the before mentioned one for MVC, then that would be totally awesome as well.</p>
  
  <p><strong>I'm not asking how to check if the User has acces to a specified Controller/Action pair</strong>. I first and foremost need to work out how to get the Controller/Action pair from the RouteTable based off the URL. The reason for all the background story, is in case that there does indeed exist an equivalent to <code>UrlAuthorizationModule.CheckUrlAccessForPrincipal</code> for MVC.</p>