Provides basic role-management functionality.
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Thetype exposes the following members.
|ApplicationName||Gets or sets the name of the application to store and retrieve role information for. (Overrides RoleProvider.ApplicationName.)|
|Description||(Inherited from ProviderBase.)|
|Name||(Inherited from ProviderBase.)|
|UserIdColumn||Gets the name of the database column that contains user IDs.|
|UserNameColumn||Gets the name of the database column that contains user names.|
|UserTableName||Gets the name of the database table that contains user information.|
|AddUsersToRoles||Adds the specified user names to the specified roles. (Overrides RoleProvider.AddUsersToRoles(String(), String()).)|
|CreateRole||Adds a new role. (Overrides RoleProvider.CreateRole(String).)|
|DeleteRole||Deletes the specified role. (Overrides RoleProvider.DeleteRole(String, Boolean).)|
|Equals||(Inherited from Object.)|
|Finalize||(Inherited from Object.)|
|FindUsersInRole||Returns all of the specified users who are in the specified role. (Overrides RoleProvider.FindUsersInRole(String, String).)|
|GetAllRoles||Returns a list of all roles. (Overrides RoleProvider.GetAllRoles.)|
|GetHashCode||(Inherited from Object.)|
|GetRolesForUser||Returns a list of the roles that a specified user is in. (Overrides RoleProvider.GetRolesForUser(String).)|
|GetType||(Inherited from Object.)|
|GetUsersInRole||Returns the user names that are in the specified role. (Overrides RoleProvider.GetUsersInRole(String).)|
|Initialize||(Inherited from ProviderBase.)|
|IsUserInRole||Returns a value that indicates whether the specified user is in the specified role. (Overrides RoleProvider.IsUserInRole(String, String).)|
|MemberwiseClone||(Inherited from Object.)|
|RemoveUsersFromRoles||Removes the specified user names from the specified roles. (Overrides RoleProvider.RemoveUsersFromRoles(String(), String()).)|
|RoleExists||Returns a value that indicates whether a specified role exists. (Overrides RoleProvider.RoleExists(String).)|
|ToString||(Inherited from Object.)|
Roles let you define groups (for example, managers, guests, administrators, members, and so on) that you can assign users to. You can then treat all users in a role the same for security, such as granting access to resources on your website. This is often more efficient than granting or denying access individually to each user.
There are no predefined roles, and you can create any roles (using any names) that are needed for your site. In effect, roles behave like tags that you can assign to users. You can then test for these tags (roles) when a user tries to access a page or other resource.
In an ASP.NET Web Pages site, you can manage and test roles by using the Roles property of a page. For example, to determine a user is in a particular role, you can call the Roles.IsUserInRole method.
By design, the class does not implement the full range of functionality that is possible in ASP.NET role providers, as defined in the RoleProvider base class that is used by all ASP.NET role providers. If your website requires the full role provider capabilities, you can skip initialization of the Web Pages role system (that is, do not call WebSecurity.InitializeDatabaseConnection) and enable the standard membership and role providers. In that case, calls you make to the class are passed through to the standard provider (referred to as the previous provider in the class documentation). For more information, see Managing Authorization Using Roles.