In ASP.net what is the most scalable way to have role based access to pages/features/menus?
I am aware of implementations like dynamic menu creation based on roles or pages inheriting from different base pages. Web.config for different site sections.
I do not want to use the default asp.net membership table structure in the database. I want to use something less complex.
I am looking at a possibility that roles can come and go anytime without affecting pages too much. I am also looking for pe开发者_JS百科rformance.
You could create a custom RoleProvider, here is an article about it: http://davidhayden.com/blog/dave/archive/2007/10/17/CreateCustomRoleProviderASPNETRolePermissionsSecurity.aspx
Have it reference a many-to-many table that stores the role and user id relationships.
It looks like using a mature open source CMS framework like http://www.mojoportal.com/home.aspx or http://www.dotnetnuke.com/ is more suitable. They provide all the user and role management's UI for you already.
Otherwise you need to implement your own membershiprovider, roleprovider and lots of UI to handle your need.
精彩评论