Show / Hide Table of Contents

Class SoLocalPrincipal

Local implementation of SoPrincipal.

Inheritance
Object
SoPrincipal
SoLocalPrincipal
Implements
IPrincipal
Inherited Members
SoPrincipal.SetAssociatePassword(String)
SoPrincipal.IsInRole(String)
SoPrincipal.GetPrincipalCarrier()
SoPrincipal.SetPrincipalCarrier(SoPrincipalCarrier)
SoPrincipal.IsInSameCompany(Int32)
SoPrincipal.IsInCompany(Int32)
SoPrincipal.IsInProject(Int32)
SoPrincipal.IsInSameGroup(Int32)
SoPrincipal.GetFunctionRights()
SoPrincipal.HasFunctionRight(String)
SoPrincipal.HasLicense(String, String)
SoPrincipal.HasLicense(String)
SoPrincipal.GetLicense(String, String)
SoPrincipal.GetGrantedLicensesAsString()
SoPrincipal.GetGrantedLicenses()
SoPrincipal.GetLicense(String)
SoPrincipal.ToString()
SoPrincipal.SetCachedItem(String, Object, Double)
SoPrincipal.GetCachedItem(String)
SoPrincipal.RemoveCachedItem(String)
SoPrincipal.ClearCache()
SoPrincipal.CacheKeyExist(String)
SoPrincipal.TryGetCachedItem(String, Object)
SoPrincipal.Identities
SoPrincipal.TimeZone
SoPrincipal.UserName
SoPrincipal.UserType
SoPrincipal.Associate
SoPrincipal.AssociateId
SoPrincipal.CRM5Secret
SoPrincipal.IsPerson
SoPrincipal.PersonId
SoPrincipal.CountryId
SoPrincipal.HomeCountryId
SoPrincipal.ContactId
SoPrincipal.GroupId
SoPrincipal.BusinessId
SoPrincipal.CategoryId
SoPrincipal.ContactOwner
SoPrincipal.DatabaseContextIdentifier
SoPrincipal.State
SoPrincipal.CanCreateExternalPerson
SoPrincipal.RoleId
SoPrincipal.RoleName
SoPrincipal.RoleDescription
SoPrincipal.RoleType
SoPrincipal.License
SoPrincipal.FullName
SoPrincipal.EMailAddress
SoPrincipal.IsSaintEnabled
SoPrincipal.EjUserId
SoPrincipal.EjAccessLevel
SoPrincipal.EjUserStatus
SoPrincipal.SecondaryGroups
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
SoPrincipal.Identity
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
SoPrincipal.Authenticate()
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
SoPrincipal.GetAccessToken(String, 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();

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
SoPrincipal.GetSafeCredentials()
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();

Implements

System.Security.Principal.IPrincipal

Extension Methods

EnumUtil.MapEnums<From, To>(From)
SoPrincipalExtensions.IsValid(SoPrincipal)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top