Class SoLocalPrincipal
Local implementation of SoPrincipal.
Implements
Inherited Members
Namespace: SuperOffice.Security.Principal
Assembly: SoDataBase.dll
Syntax
public sealed class SoLocalPrincipal : SoPrincipal, IPrincipal
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
Properties
Identity
Local implementation of SoPrincipal.
Declaration
public override ISoIdentity Identity { get; }
Property Value
Type | Description |
---|---|
ISoIdentity |
Overrides
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
IgnoreSentry
Should sentry be ignored?
Declaration
public bool IgnoreSentry { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
Methods
Authenticate()
Authenticate AND authorize the user in the database
Declaration
public override void Authenticate()
Overrides
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
BeginIgnoreSentry()
This method can only be used by SuperOffice signed code! Start ignoring sentry.
Declaration
public SoLocalPrincipal.IgnoreSentryModifier BeginIgnoreSentry()
Returns
Type | Description |
---|---|
SoLocalPrincipal.IgnoreSentryModifier | Disposable object ignoring sentry while it is in context. Always put this value inside using(...) |
Remarks
This class carries out the database authentication.
Examples
This code should be used as part of a using section:
SuperOffice.Security.Permissions.SoStrongName.Permission.Assert();
using (localPrincipal.BeginIgnoreSentry())
{
// ToDo: Your stuff that by-passes Sentry
}
GetAccessToken(String, Boolean)
Local implementation of SoPrincipal.
Declaration
public override string GetAccessToken(string applicationToken, bool includeCsSession)
Parameters
Type | Name | Description |
---|---|---|
String | applicationToken | |
Boolean | includeCsSession |
Returns
Type | Description |
---|---|
String |
Overrides
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
GetCurrent(SoTable)
Get the current item, the item on top of the items in the history.
Declaration
public int GetCurrent(SoTable table)
Parameters
Type | Name | Description |
---|---|---|
SoTable | table | Reference to the table to get the current item for. |
Returns
Type | Description |
---|---|
Int32 | Primary key of the record that is the current record of this table. |
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
GetHistory(SoTable)
Get history for the table
Declaration
public int[] GetHistory(SoTable table)
Parameters
Type | Name | Description |
---|---|---|
SoTable | table | Reference to the table to get the history for. |
Returns
Type | Description |
---|---|
Int32[] | List of primary keys of records from the table. |
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
GetSafeCredentials()
Obtain a set of credentials that are safe to use accross mix-mode authentication scenarios.
Declaration
public override SoCredentials GetSafeCredentials()
Returns
Type | Description |
---|---|
SoCredentials | Credentials that are safe to use accross mix-mode authentication scenarios |
Overrides
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
HasGrantedModuleLicense(IEnumerable<GrantedModuleLicense>, String)
Local implementation of SoPrincipal.
Declaration
public static bool HasGrantedModuleLicense(IEnumerable<GrantedModuleLicense> licenses, string licenseName)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<GrantedModuleLicense> | licenses | |
String | licenseName |
Returns
Type | Description |
---|---|
Boolean |
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
ParseRole(SoPrincipalCarrier, SoDataReader)
Local implementation of SoPrincipal.
Declaration
public void ParseRole(SoPrincipalCarrier carrier, SoDataReader reader)
Parameters
Type | Name | Description |
---|---|---|
SoPrincipalCarrier | carrier | |
SoDataReader | reader |
Remarks
This class carries out the database authentication.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
ReAuthorize()
Re-run the authorization, without changing the authentication of the current local principal. You must be in state Authorized to run this method.
Declaration
public void ReAuthorize()
Remarks
This method is intended for situations where you have switched databases or changed things that influence authorization, but don't want to (or cannot) do a full reauthentication. All authorization-related data will be re-read, but the basic user identity will be carried over.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();
SetCurrent(SoTable, Int32)
Set the current item, the item on top of the items in the history.
Declaration
public void SetCurrent(SoTable table, int record)
Parameters
Type | Name | Description |
---|---|---|
SoTable | table | Reference to the table to set the current item for. |
Int32 | record | Primary key of the record that is to be the current record of this table. |
Remarks
Other items in the history are shifted down. Items exceeding the maximum numer of items in the history are removed.
Examples
Use the SoSession object to authenticate users.
SoSession session = SoSession.Authenticate("user","password");
// do some stuff.
session.Close();