Επεξεργασία

Κοινή χρήση μέσω


RoleProvider Class

Definition

Defines the contract that ASP.NET implements to provide role-management services using custom role providers.

public ref class RoleProvider abstract : System::Configuration::Provider::ProviderBase
public abstract class RoleProvider : System.Configuration.Provider.ProviderBase
type RoleProvider = class
    inherit ProviderBase
Public MustInherit Class RoleProvider
Inherits ProviderBase
Inheritance
RoleProvider
Derived

Remarks

ASP.NET role management is designed to enable you to easily use a number of different role providers for your ASP.NET applications. You can use the supplied role providers that are included with the .NET Framework, or you can implement your own provider.

When implementing a custom role provider, you are required to inherit the RoleProvider abstract class.

There are two primary reasons for creating a custom role provider.

  • You need to store role information in a data source that is not supported by the role providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data sources.

  • You need to manage role information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework. A common example of this would be role data that already exists in a SQL Server database for a company or Web site.

Constructors

RoleProvider()

Initializes a new instance of the RoleProvider class.

Properties

ApplicationName

Gets or sets the name of the application to store and retrieve role information for.

Description

Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).

(Inherited from ProviderBase)
Name

Gets the friendly name used to refer to the provider during configuration.

(Inherited from ProviderBase)

Methods

AddUsersToRoles(String[], String[])

Adds the specified user names to the specified roles for the configured applicationName.

CreateRole(String)

Adds a new role to the data source for the configured applicationName.

DeleteRole(String, Boolean)

Removes a role from the data source for the configured applicationName.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindUsersInRole(String, String)

Gets an array of user names in a role where the user name contains the specified user name to match.

GetAllRoles()

Gets a list of all the roles for the configured applicationName.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetRolesForUser(String)

Gets a list of the roles that a specified user is in for the configured applicationName.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUsersInRole(String)

Gets a list of users in the specified role for the configured applicationName.

Initialize(String, NameValueCollection)

Initializes the configuration builder.

(Inherited from ProviderBase)
IsUserInRole(String, String)

Gets a value indicating whether the specified user is in the specified role for the configured applicationName.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RemoveUsersFromRoles(String[], String[])

Removes the specified user names from the specified roles for the configured applicationName.

RoleExists(String)

Gets a value indicating whether the specified role name already exists in the role data source for the configured applicationName.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also