ASP.NET Security Roles AND Permissions

前端 未结 5 1329
[愿得一人]
[愿得一人] 2021-01-03 00:35

I\'m comfortable with the ASP.NET security model whereby one can allow/deny access to users in the web.config based on what roles they are in e.g.



        
5条回答
  •  半阙折子戏
    2021-01-03 00:45

    Yes it's possible. Create the roles you want, add the users to the roles, and then just check User.IsInRole in your code where you perform the action that requires that role.

    Take a look at the Roles and MemberShip classes in System.Web.Security

提交回复
热议问题