title: ASP.net MVC: Getting Required Roles for Login?
body: <p>is there any generic way to get the role which is required for some particular action?</p>
  
  <p>In Detail my problem is, that I have e.g. 2 roles "User" and "Admin" and an action with the following:</p>
  
  <p>[Authorize(Roles = "Admin")]
  public class AdministrationController... </p>
  
  <p>If the user is not logged in, he gets the login screen. That's ok. When a user with the role "Admin" logs in, all works fine. But if a user with the role "user" logs in, he will be continiously displayed the login screen, besides he has succesfully logged in, but of course not the required role.</p>
  
  <p>So it would be good if the login display could display to him a hint, telling that he is already logged in, but he has not the required rights to see this page. And additionally it may display the required role(s).</p>
  
  <p>Thanks,
  Michael</p>