C# Class CtcApi.Web.Security.ActiveDirectoryRoleProvider

Inheritance: System.Web.Security.RoleProvider
Show file Open project: BellevueCollege/CtcApi

Private Properties

Property Type Description
ADSearch String[]
DetermineApplicationName void
PopulateLists void
ReadConfig string
RecurseGroup void

Public Methods

Method Description
ActiveDirectoryRoleProvider ( ) : System

Initializes a new instance of the ADRoleProvider class.

AddUsersToRoles ( string usernames, string rolenames ) : void

AddUsersToRoles not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.

CreateRole ( string rolename ) : void

CreateRole not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.

DeleteRole ( string rolename, bool throwOnPopulatedRole ) : bool

DeleteRole not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.

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

Return sorted list of usernames like usernameToMatch in rolename

GetAllRoles ( ) : string[]

Retrieve listing of all roles.

GetRolesForUser ( string username ) : string[]

Retrieve listing of all roles to which a specified user belongs.

GetUsersInRole ( String rolename ) : string[]

Retrieve listing of all users in a specified role.

Initialize ( String name, NameValueCollection config ) : void

Initialize ADRoleProvider with config values

IsUserInRole ( string username, string rolename ) : bool

Determine if a specified user is in a specified role.

IsUserInRoles ( IPrincipal user ) : bool

Provides static access to determine if a user is a mamber of one or more roles

RemoveUsersFromRoles ( string usernames, string rolenames ) : void

RemoveUsersFromRoles not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.

RoleExists ( string rolename ) : bool

Determine if given role exists

Private Methods

Method Description
ADSearch ( String ConnectionString, String filter, String field ) : String[]

Performs an extremely constrained query against Active Directory. Requests only a single value from AD based upon the filtering parameter to minimize performance hit from large queries.

DetermineApplicationName ( NameValueCollection config ) : void
PopulateLists ( NameValueCollection config ) : void
ReadConfig ( NameValueCollection config, string key ) : string
RecurseGroup ( System.DirectoryServices.AccountManagement.PrincipalContext context, string group, List groups ) : void

Method Details

ActiveDirectoryRoleProvider() public method

Initializes a new instance of the ADRoleProvider class.
public ActiveDirectoryRoleProvider ( ) : System
return System

AddUsersToRoles() public method

AddUsersToRoles not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.
public AddUsersToRoles ( string usernames, string rolenames ) : void
usernames string
rolenames string
return void

CreateRole() public method

CreateRole not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.
public CreateRole ( string rolename ) : void
rolename string
return void

DeleteRole() public method

DeleteRole not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.
public DeleteRole ( string rolename, bool throwOnPopulatedRole ) : bool
rolename string
throwOnPopulatedRole bool
return bool

FindUsersInRole() public method

Return sorted list of usernames like usernameToMatch in rolename
public FindUsersInRole ( string rolename, string usernameToMatch ) : string[]
rolename string Role to check
usernameToMatch string Partial username to check
return string[]

GetAllRoles() public method

Retrieve listing of all roles.
public GetAllRoles ( ) : string[]
return string[]

GetRolesForUser() public method

Retrieve listing of all roles to which a specified user belongs.
public GetRolesForUser ( string username ) : string[]
username string
return string[]

GetUsersInRole() public method

Retrieve listing of all users in a specified role.
public GetUsersInRole ( String rolename ) : string[]
rolename String String array of users
return string[]

Initialize() public method

Initialize ADRoleProvider with config values
public Initialize ( String name, NameValueCollection config ) : void
name String
config System.Collections.Specialized.NameValueCollection
return void

IsUserInRole() public method

Determine if a specified user is in a specified role.
public IsUserInRole ( string username, string rolename ) : bool
username string
rolename string
return bool

IsUserInRoles() public static method

Provides static access to determine if a user is a mamber of one or more roles
public static IsUserInRoles ( IPrincipal user ) : bool
user IPrincipal
return bool

RemoveUsersFromRoles() public method

RemoveUsersFromRoles not supported. For security and management purposes, ADRoleProvider only supports read operations against Active Direcory.
public RemoveUsersFromRoles ( string usernames, string rolenames ) : void
usernames string
rolenames string
return void

RoleExists() public method

Determine if given role exists
public RoleExists ( string rolename ) : bool
rolename string Role to check
return bool