58 lines
2.3 KiB
C#
58 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Sarand.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
|
|
namespace Sarand.Net.Standard.Base.Security
|
|
{
|
|
//=======================================================================
|
|
public abstract partial class SaSecurityMgr : SacsItemMgr
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private List<TypeCodeDesc> securityItemTypes;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Static initialisation.
|
|
static SaSecurityMgr ()
|
|
{
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
protected SaSecurityMgr ()
|
|
{
|
|
securityItemTypes = SaSecurityConsole.SecurityItemTypes;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Database properties.
|
|
public abstract bool DatabaseIsValid { get; }
|
|
public abstract bool CanUpdateDatabase { get; }
|
|
public abstract bool ColumnExists (SaSecurityDbDfn.ColumnIdx columnIdx);
|
|
|
|
//-------------------------------------------------------------------
|
|
// Password utilities.
|
|
|
|
/// <summary>Store the password against against the user.</summary>
|
|
public abstract bool SetPassword(SaSecurityItem securityItemUser, String password);
|
|
|
|
/// <summary>Does the password match that currently defined against the user.</summary>
|
|
public abstract bool PasswordMatches(SaSecurityItem securityItemUser, String password, DbUpdateInfo dbUpdateInfo);
|
|
|
|
/// <summary>Is the password currently defined against the user blank.</summary>
|
|
public abstract bool PasswordIsBlank(SaSecurityItem securityItemUser);
|
|
|
|
/// <summary>Generate password hash using the specified method.</summary>
|
|
public abstract String EncodePassword_Hex(String password, SaSecurity.PasswordHashMethod method = SaSecurity.PasswordHashMethod.MsSql);
|
|
|
|
/// <summary>Compare password to hashed value using the specified method.</summary>
|
|
public abstract bool ComparePassword_Hex(String password, String passwordHashHex, SaSecurity.PasswordHashMethod method = SaSecurity.PasswordHashMethod.MsSql);
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|