继承自:System.web.Security.RoleProvider抽象类提供了角色提供者。
.net2.0之后就提供了RoleProvider类的具体实现,有两种:
AuthorizationStoreRoleProvider他把授权存储到Authorization store中、
另一个实现是SqlRoleProvider使用sqlserver存储角色信息。
如果我们对这两种情况都不是很满意,可以比较容易的实现自己的角色提供程序。虽然它在system.web
命名空间下,但在其他程序中都可以用。
静态类System.web.Security.Roles为角色提供管理提供了另一层封装。
他隐藏了对角色提供程序的操作。
但在配置文件中,<System.web>
<RoleManager defaultProvider="你的提供者实现"
enableed="true"
cacheRolesInCookie="true"
cookieName=".aspRoles"
cookieTimeOut="30"
cookiePath="/"
cookieRequireSSL="false"
cookeSlidingExpiration="true"
cookeiProtection="All">
<providers>
<clear/>
<add
name="你的提供者实现"
type="System.web.Security.AtuhorizationStroeRoleProvider"
connectionName="Sameple"
cacheRefreshInterval="60"
scopName=""/>
</providers>
</RoleManager>
</System.web>
</Configuration>