title: ASP .Net MVC get decorated roles for unathorized request
body: <p>In MVC we decorate actions using <a href="https://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute(v=vs.100).aspx#using_authorizeattribute" rel="nofollow">AuthorizeAttribute</a>. When a given user is not authorized for a particular action it calls <a href="https://msdn.microsoft.com/en-us/library/ee427992(v=vs.100).aspx" rel="nofollow">HandleUnauthorizedRequest</a> method. I have overridden this method in my custom class called <code>CustomAuthorizeAttribute</code> that inherits from <code>AuthorizeAttribute</code>. With in the scope of my overridden <code>HandleUnauthorizedRequest</code> method how do I get all the roles that current user is not part of which made him/her unauthorized? For example if I decorate my action as <code>[CustomAuthorize(Roles = "AreaUser")]</code> and I come to my <code>HandleUnauthorizedRequest</code> I would like to know that the user is not part of "AreaUser" so that I can display that on a redirected permission denied page.</p>