Role Manager is a feature that was added in ASP.NET 2.0 and fully supported in ASP.NET 3.5 that provides the basic functionality necessary to create an IPrincipal-based object associated with roles. The motivation for the Role Manager feature is to make it easy for developers to associate users with roles and then perform role checks both declaratively and in code. The Role Manager feature is sometimes referred to as a companion feature to Membership because Role Manager can be used to provide authorization for users that have been authenticated using Membership. However, Role Manager can also be used as a standalone feature that integrates with other authentication mechanisms, including Windows authentication.
As with the Membership feature, Role Manager can be used in non-ASP.NET environments such as the Windows Forms application and console applications, thus making it easier for developers to share a common set of authenticated users and role information across different client applications. This chapter will cover:
The Role class
The RolePrincipal class
The RoleManager model