C# Class Worki.Memberships.WorkiRoleProvider

Inheritance: System.Web.Security.RoleProvider
显示文件 Open project: tah91/eworkyWebSite

Public Methods

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

Adds a collection of users to a collection of corresponding roles

CreateRole ( string roleName ) : void

Creates a new role

DeleteRole ( string roleName, bool throwOnPopulatedRole ) : bool

Deletes a given role

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

Finds a set of users in a given role

GetAllRoles ( ) : string[]

Gets all available user roles

GetRolesForUser ( string username ) : string[]

Gets the assigned roles for a particular user.

GetUsersInRole ( string roleName ) : string[]

Gets all the users in a particular role

Initialize ( string name, System config ) : void

Initialize the RoleProvider

IsUserInRole ( string username, string roleName ) : bool

Checks if a given username is in a particular role

RemoveUsersFromRoles ( string usernames, string roleNames ) : void

Remove a collection of users from a collection of corresponding roles

RoleExists ( string roleName ) : bool

Checks if a given role already exists in the database

Private Methods

Method Description
GetConfigValue ( string configValue, string defaultValue ) : string

Method Details

AddUsersToRoles() public method

Adds a collection of users to a collection of corresponding roles
public AddUsersToRoles ( string usernames, string roleNames ) : void
usernames string
roleNames string
return void

CreateRole() public method

Creates a new role
public CreateRole ( string roleName ) : void
roleName string
return void

DeleteRole() public method

Deletes a given role
public DeleteRole ( string roleName, bool throwOnPopulatedRole ) : bool
roleName string Role name to delete
throwOnPopulatedRole bool Specifies whether the function should throw /// if there are assigned users to this role
return bool

FindUsersInRole() public method

Finds a set of users in a given role
public FindUsersInRole ( string roleName, string usernameToMatch ) : string[]
roleName string
usernameToMatch string
return string[]

GetAllRoles() public method

Gets all available user roles
public GetAllRoles ( ) : string[]
return string[]

GetRolesForUser() public method

Gets the assigned roles for a particular user.
public GetRolesForUser ( string username ) : string[]
username string Matching username
return string[]

GetUsersInRole() public method

Gets all the users in a particular role
public GetUsersInRole ( string roleName ) : string[]
roleName string
return string[]

Initialize() public method

Initialize the RoleProvider
public Initialize ( string name, System config ) : void
name string
config System
return void

IsUserInRole() public method

Checks if a given username is in a particular role
public IsUserInRole ( string username, string roleName ) : bool
username string
roleName string
return bool

RemoveUsersFromRoles() public method

Remove a collection of users from a collection of corresponding roles
public RemoveUsersFromRoles ( string usernames, string roleNames ) : void
usernames string
roleNames string
return void

RoleExists() public method

Checks if a given role already exists in the database
public RoleExists ( string roleName ) : bool
roleName string Role name to search
return bool