C# Class MySql.Web.Security.MySQLRoleProvider

Manages storage of role membership information for an ASP.NET application in a MySQL database.
Inheritance: System.Web.Security.RoleProvider
Datei anzeigen Open project: elevate/mysqlconnector-.net Class Usage Examples

Public Methods

Method Description
AddUsersToRoles ( string usernames, string rolenames ) : void

Adds the users to roles.

CreateRole ( string rolename ) : void

Creates the role.

DeleteRole ( string rolename, bool throwOnPopulatedRole ) : bool

Deletes the role.

FindUsersInRole ( string rolename, string usernameToMatch ) : string[]

Finds the users in role.

GetAllRoles ( ) : string[]

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

GetRolesForUser ( string username ) : string[]

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

GetUsersInRole ( string rolename ) : string[]

Gets the users in role.

Initialize ( string name, NameValueCollection config ) : void

Initializes the provider.

IsUserInRole ( string username, string rolename ) : bool

Determines whether [is user in role] [the specified username].

RemoveUsersFromRoles ( string usernames, string rolenames ) : void

Removes the users from roles.

RoleExists ( string rolename ) : bool

Roles the exists.

Private Methods

Method Description
DeleteUserData ( MySqlConnection connection, int userId ) : void
GetRoleId ( MySqlConnection connection, string rolename ) : int
GetRolesByUserName ( MySqlConnection connection, string username ) : string[]
GetUserId ( MySqlConnection connection, string username ) : int
WriteToEventLog ( Exception e, string action ) : void

Method Details

AddUsersToRoles() public method

Adds the users to roles.
public AddUsersToRoles ( string usernames, string rolenames ) : void
usernames string The usernames.
rolenames string The rolenames.
return void

CreateRole() public method

Creates the role.
public CreateRole ( string rolename ) : void
rolename string The rolename.
return void

DeleteRole() public method

Deletes the role.
public DeleteRole ( string rolename, bool throwOnPopulatedRole ) : bool
rolename string The rolename.
throwOnPopulatedRole bool if set to true [throw on populated role].
return bool

FindUsersInRole() public method

Finds the users in role.
public FindUsersInRole ( string rolename, string usernameToMatch ) : string[]
rolename string The rolename.
usernameToMatch string The username to match.
return string[]

GetAllRoles() public method

Gets a list of all the roles for the configured applicationName.
public GetAllRoles ( ) : string[]
return string[]

GetRolesForUser() public method

Gets a list of the roles that a specified user is in for the configured applicationName.
public GetRolesForUser ( string username ) : string[]
username string The user to return a list of roles for.
return string[]

GetUsersInRole() public method

Gets the users in role.
public GetUsersInRole ( string rolename ) : string[]
rolename string The rolename.
return string[]

Initialize() public method

Initializes the provider.
The name of the provider is null. The name of the provider has a length of zero. An attempt is made to call on a provider after the provider has already been initialized.
public Initialize ( string name, NameValueCollection config ) : void
name string The friendly name of the provider.
config System.Collections.Specialized.NameValueCollection A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.
return void

IsUserInRole() public method

Determines whether [is user in role] [the specified username].
public IsUserInRole ( string username, string rolename ) : bool
username string The username.
rolename string The rolename.
return bool

RemoveUsersFromRoles() public method

Removes the users from roles.
public RemoveUsersFromRoles ( string usernames, string rolenames ) : void
usernames string The usernames.
rolenames string The rolenames.
return void

RoleExists() public method

Roles the exists.
public RoleExists ( string rolename ) : bool
rolename string The rolename.
return bool