ASP.NET Security Roles AND Permissions

前端 未结 5 1309
[愿得一人]
[愿得一人] 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条回答
  •  梦毁少年i
    2021-01-03 00:54

    You could return PERMISSIONS instead of the ROLES in your RoleProvider.

    public override string[] GetRolesForUser(string username) {
       return GetGrantedPermissions(userName);
    }
    

    Then create your admin pages to add {granted/denied} permissions to roles and of course users to roles.

提交回复
热议问题