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

The xml role provider.
Наследование: System.Web.Security.RoleProvider
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
ReadMembershipDataStore void
ReadRoleDataStore void
RemoveItemFromList void

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

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

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

CreateRole ( string roleName ) : void

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

DeleteRole ( string roleName, bool throwOnPopulatedRole ) : bool

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

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

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

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 a list of users in the specified role for the configured applicationName.

Initialize ( string name, NameValueCollection config ) : void

Initializes the provider.

IsUserInRole ( string username, string roleName ) : bool

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

RemoveUsersFromRoles ( string usernames, string roleNames ) : void

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

RoleExists ( string roleName ) : bool

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

Save ( ) : void

Saves this instance.

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

Метод Описание
ReadMembershipDataStore ( ) : void

Only so we can add users to the adminstrators role.

ReadRoleDataStore ( ) : void

Builds the internal cache of users.

RemoveItemFromList ( ICollection list, string item ) : void

The remove item from list.

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

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

Adds the specified user names to the specified roles for the configured applicationName.
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 data source for the configured applicationName.
public CreateRole ( string roleName ) : void
roleName string /// The name of the role to create. ///
Результат void

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

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

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

Gets an array of user names in a role where the user name contains the specified user name to match.
public FindUsersInRole ( string roleName, string usernameToMatch ) : string[]
roleName string /// The role to search in. ///
usernameToMatch string /// The user name to search for. ///
Результат string[]

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

Gets a list of all the roles for the configured applicationName.
public GetAllRoles ( ) : string[]
Результат string[]

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

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. ///
Результат string[]

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

Gets a list of users in the specified role for the configured applicationName.
public GetUsersInRole ( string roleName ) : string[]
roleName string /// The name of the role to get the list of users for. ///
Результат string[]

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

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. ///
Результат void

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

Gets a value indicating whether the specified user is in the specified role for the configured applicationName.
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 the specified user names from the specified roles for the configured applicationName.
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() публичный Метод

Gets a value indicating whether the specified role name already exists in the role data source for the configured applicationName.
public RoleExists ( string roleName ) : bool
roleName string /// The name of the role to search for in the data source. ///
Результат bool

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

Saves this instance.
public Save ( ) : void
Результат void