C# Класс BlogEngine.Core.Providers.DbRoleProvider

Generic Db Role Provider
Наследование: System.Web.Security.RoleProvider
Показать файл Открыть проект

Открытые методы

Метод Описание
AddUsersToRoles ( string usernames, string roleNames ) : void

Adds all users in user array to all roles in role array

CreateRole ( string roleName ) : void

Adds a new role to the database

DeleteRole ( string roleName, bool throwOnPopulatedRole ) : bool

Removes a role from database

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

Returns all users in selected role with names that match usernameToMatch

GetAllRoles ( ) : string[]

Returns array of all roles in database

GetRolesForUser ( string username ) : string[]

Return an array of roles that user is in

GetUsersInRole ( string roleName ) : string[]

Returns array of users in selected role

Initialize ( string name, NameValueCollection config ) : void

Initializes the provider

IsUserInRole ( string username, string roleName ) : bool

Check to see if user is in a role

RemoveUsersFromRoles ( string usernames, string roleNames ) : void

Removes all users in user array from all roles in role array

RoleExists ( string roleName ) : bool

Checks to see if role exists

Приватные методы

Метод Описание
CreateConnection ( ) : DbConnectionHelper
FormatParamName ( string parameterName ) : string

Returns a formatted parameter name to include this DbRoleProvider instance's paramPrefix.

Описание методов

AddUsersToRoles() публичный Метод

Adds all users in user array to all roles in role array
public AddUsersToRoles ( string usernames, string roleNames ) : void
usernames string A string array of user names to be added to the specified roles.
roleNames string A string array of the role names to add the specified user names to.
Результат void

CreateRole() публичный Метод

Adds a new role to the database
public CreateRole ( string roleName ) : void
roleName string The name of the role to create.
Результат void

DeleteRole() публичный Метод

Removes a role from database
public DeleteRole ( string roleName, bool throwOnPopulatedRole ) : bool
roleName string The name of the role to delete.
throwOnPopulatedRole bool If true, throw an exception if has one or more members and do not delete .
Результат bool

FindUsersInRole() публичный Метод

Returns all users in selected role with names that match usernameToMatch
public FindUsersInRole ( string roleName, string usernameToMatch ) : string[]
roleName string The role to search in.
usernameToMatch string The user name to search for.
Результат string[]

GetAllRoles() публичный Метод

Returns array of all roles in database
public GetAllRoles ( ) : string[]
Результат string[]

GetRolesForUser() публичный Метод

Return an array of roles that user is in
public GetRolesForUser ( string username ) : string[]
username string The user to return a list of roles for.
Результат string[]

GetUsersInRole() публичный Метод

Returns array of users in selected role
public GetUsersInRole ( string roleName ) : string[]
roleName string The name of the role to get the list of users for.
Результат string[]

Initialize() публичный Метод

Initializes the provider
public Initialize ( string name, NameValueCollection config ) : void
name string /// Configuration name ///
config System.Collections.Specialized.NameValueCollection /// Configuration settings ///
Результат void

IsUserInRole() публичный Метод

Check to see if user is in a role
public IsUserInRole ( string username, string roleName ) : bool
username string The user name to search for.
roleName string The role to search in.
Результат bool

RemoveUsersFromRoles() публичный Метод

Removes all users in user array from all roles in role array
public RemoveUsersFromRoles ( string usernames, string roleNames ) : void
usernames string A string array of user names to be removed from the specified roles.
roleNames string A string array of role names to remove the specified user names from.
Результат void

RoleExists() публичный Метод

Checks to see if role exists
public RoleExists ( string roleName ) : bool
roleName string The name of the role to search for in the data source.
Результат bool