C# Class GSF.Security.SecurityProviderBase

Base class for a provider of role-based security in applications.
Inheritance: ISecurityProvider
显示文件 Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
Authenticate ( string password ) : bool

When overridden in a derived class, authenticates the user.

ChangePassword ( string oldPassword, string newPassword ) : bool

When overridden in a derived class, changes user password in the backend datastore.

Dispose ( ) : void

Releases all the resources used by the security provider.

Initialize ( ) : void

Initializes the security provider.

LoadSettings ( ) : void

Loads saved security provider settings from the config file if the PersistSettings property is set to true.

RefreshData ( ) : bool

When overridden in a derived class, refreshes the UserData from the backend datastore.

ResetPassword ( string securityAnswer ) : bool

When overridden in a derived class, resets user password in the backend datastore.

SaveSettings ( ) : void

Saves security provider settings to the config file if the PersistSettings property is set to true.

TranslateRole ( string role ) : string

Performs a translation of the specified user role.

UpdateData ( ) : bool

When overridden in a derived class, updates the UserData in the backend datastore.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the security provider and optionally releases the managed resources.

SecurityProviderBase ( string username, bool canRefreshData, bool canUpdateData, bool canResetPassword, bool canChangePassword ) : System

Initializes a new instance of the security provider.

Method Details

Authenticate() public abstract method

When overridden in a derived class, authenticates the user.
public abstract Authenticate ( string password ) : bool
password string Password to be used for authentication.
return bool

ChangePassword() public abstract method

When overridden in a derived class, changes user password in the backend datastore.
public abstract ChangePassword ( string oldPassword, string newPassword ) : bool
oldPassword string User's current password.
newPassword string User's new password.
return bool

Dispose() public method

Releases all the resources used by the security provider.
public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by the security provider and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

Initialize() public method

Initializes the security provider.
public Initialize ( ) : void
return void

LoadSettings() public method

Loads saved security provider settings from the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public LoadSettings ( ) : void
return void

RefreshData() public abstract method

When overridden in a derived class, refreshes the UserData from the backend datastore.
public abstract RefreshData ( ) : bool
return bool

ResetPassword() public abstract method

When overridden in a derived class, resets user password in the backend datastore.
public abstract ResetPassword ( string securityAnswer ) : bool
securityAnswer string Answer to the user's security question.
return bool

SaveSettings() public method

Saves security provider settings to the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public SaveSettings ( ) : void
return void

SecurityProviderBase() protected method

Initializes a new instance of the security provider.
protected SecurityProviderBase ( string username, bool canRefreshData, bool canUpdateData, bool canResetPassword, bool canChangePassword ) : System
username string Name that uniquely identifies the user.
canRefreshData bool true if the security provider can refresh from the backend data store, otherwise false.
canUpdateData bool true if the security provider can update in the backend data store, otherwise false.
canResetPassword bool true if the security provider can reset user password, otherwise false.
canChangePassword bool true if the security provider can change user password, otherwise false.
return System

TranslateRole() public method

Performs a translation of the specified user role.
public TranslateRole ( string role ) : string
role string The user role to be translated.
return string

UpdateData() public abstract method

When overridden in a derived class, updates the UserData in the backend datastore.
public abstract UpdateData ( ) : bool
return bool