简体   繁体   中英

ASP.NET MVC User based Privileges for Controller Actions

I have application where I want to grant or prohibited the roles to access the Controller.

Admin can change the the privilege of roles in roles management.

below is pic of role management where admin can change the privilege

How to apply Authorization on Controllers based on these dynamically changing privileges.

I think this is exactly what you need. You can create custom policies, in your case a policy per controller where you get the roles from the database in your custom policy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM