共用方式為


Role Management Classes

Role management consists of a set of classes and interfaces that establish roles for the current user and manage role information. The following table shows the role management classes and functions that they provide.

Class/Interface Functions

Roles

Provides general management facilities for roles.

Creates roles.

Adds users to roles.

Determines whether specific user is in role.

Gets roles for users.

Removes users from role.

Manages the cookie containing role information.

NoteNote
The functions for creating roles and assigning users to them do not work if you are using the WindowsTokenRoleProvider. In that case, you manage role information using Windows.

RoleProvider

Defines functionality for data providers that can be used by role-management services.

Defines the functionality a provider must implement to be used by the Roles class.

RoleManagerModule

Adds role information to the current User property.

Automatically creates a RolePrincipal and attaches it to the current context.

Raises a GetRoles event that allows you to customize the process of adding roles to the current user context.

RoleManagerEventArgs

Defines arguments passed to the RoleManager_GetRoles event.

Provides access to the current user context during the GetRoles event.

RolePrincipal

Acts as a IPrincipal object and caches the roles for a user.

Stores role information for the current user.

Manages retrieval of role information from either the cookie or the database (or both, if necessary).

See Also

Concepts

Understanding Role Management
Role Management Providers

Other Resources

ASP.NET Web Site Security