title: Assign custom class permissions check for controller actions in ASP.NET MVC4
body: <p>I have an ASP.NET MVC4 site with custom user/role provider. Entity Framework works with the user and role entities at the bottom level. Now I am introducing a concept of <code>RolePermission</code>s. Each role has an asscocialted list of permissions that allow users in this role to perform certain actions within the system, like deleting comments for example. </p>
  
  <p>In my custom-build admin panel I want to list all the actions of a controllers and have an ability to allow or disallow the call to some action based on the presenace of a permission in the curent user's role.</p>
  
  <p>Questions are:</p>
  
  <ol>
  <li>Is it possible?</li>
  <li>How do I list a set of actions in the controller.</li>
  <li>How do I assign or cancel an association between action and a role permission.</li>
  </ol>
  
  <p>Possible starategy:</p>
  
  <p>I introduce a global custom filter that is applied to all of the controllers and actions, that checks my database to see If I have a logical association. This way a checking code is ran every time the user makes a call to an action. Still how do I list controllers and actions (via reflection perhaps?)</p>