title: Dynamically assign controller action permissions to roles in asp.net MVC
body: <p>I am working on asp.net mvc 5. I want to assign permissions of controllers' action methods to roles dynamically without hard conding the roles in Authorize attribute.</p>
  
  <p>Here is the scenario - 
  In my project, I have four roles - Student, Teacher, Program Officer and Admin.
  I want that admin can change the accessability of each role whenever he wishes. I do not want to hard code the authorize attribute with role names before every action name of controller because admin will not then be able to change the permissions of each role.</p>
  
  <p>I want to create a page where every action method of controller will be listed as checkbox and admin can select action checkboxes for a role. Then that role users will get accessability of those action methods.</p>
  
  <p>Here I want to make the UI as following - </p>
  
  <p><a href="https://i.stack.imgur.com/5cgk2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5cgk2.png" alt="Role Management UI"></a></p>
  
  <p>Can anyone please help me to do this by giving any suggestion or code or link?</p>