Show / Hide Table of Contents

Class SaleSentry

SaleSentry guards Sale entities and their component rows.

The SaleSentry applies to the following classes: Sale, SaleRow, TextRow, UDLarge + UDSmall

Inheritance
object
Sentry
Sentry<SaleTableInfo>
RoleRightsSentry<SaleTableInfo>
SaleSentry
Implements
ICloneable
Inherited Members
RoleRightsSentry<SaleTableInfo>.GetMainRight()
RoleRightsSentry<SaleTableInfo>.RoleTableRights
RoleRightsSentry<SaleTableInfo>.VisibleForRights
Sentry<SaleTableInfo>.GetInterestingFieldsInTable(TableInfo)
Sentry<SaleTableInfo>.InterestedInAnyInstanceOf<T>()
Sentry<SaleTableInfo>.SuperComputeDerivedTableRights()
Sentry<SaleTableInfo>.ComputeDerivedTableRight(TableRight)
Sentry<SaleTableInfo>.SuperComputeTableRights()
Sentry<SaleTableInfo>.AddInterestingTables(params TableInfo[])
Sentry<SaleTableInfo>.ComputeLicenseExpiration()
Sentry<SaleTableInfo>.SuperComputeFieldRights()
Sentry<SaleTableInfo>.CanCoverTable(TableInfo)
Sentry<SaleTableInfo>.IsTableCovered(TableInfo)
Sentry<SaleTableInfo>.SetAllTableRights(ETableRight, string)
Sentry<SaleTableInfo>.GetOwnerFieldRight()
Sentry<SaleTableInfo>.AnalyzeQuery(PrivateSelect)
Sentry<SaleTableInfo>.ToString()
Sentry<SaleTableInfo>.InterestingFields
Sentry<SaleTableInfo>.SentryQueryInfo
Sentry.kTableRights
Sentry.kFieldRights
Sentry._tableRights
Sentry._fieldRights
Sentry._lookups
Sentry.DemandPlugins()
Sentry.CreateSentry(TableInfo)
Sentry.CreateSentries(Select)
Sentry.BeginIgnoreSentry()
Sentry.BeginIgnoreRowSentry()
Sentry.IgnoreRowSentry()
Sentry.IgnoreSentry()
Sentry.IterateLookups(LookupCollection)
Sentry.GetIntField(params FieldInfo[])
Sentry.GetPersistedIntField(params FieldInfo[])
Sentry.GetIsGhostField(FieldInfo)
Sentry.GetDateTimeField(FieldInfo)
Sentry.GetStringField(FieldInfo)
Sentry.ClearRights()
Sentry.GetRecordOwnershipIndex()
Sentry.GetRecordOwnershipIndex(int, int)
Sentry.MapTableToFieldRights(TableInfo, TableRight, FieldInfo[])
Sentry.MakeFieldFromTableRight(TableRight)
Sentry.MakeFieldFromTableRight(TableRight, ETableRight)
Sentry.MakeFieldFromTableRight(ETableRight)
Sentry.GetTableRight(TableInfo)
Sentry.GetFieldRight(FieldInfo)
Sentry.CanTableDo(TableInfo, ETableRight, bool)
Sentry.CanFieldDo(FieldInfo, EFieldRight, bool)
Sentry.IsFieldCovered(FieldInfo)
Sentry.GetGroupFromAssociate(int)
Sentry.IsContactDatabaseOwner(int)
Sentry.IsContactEmployeeUserOwner(int)
Sentry.IsContactSatelliteOwner(int)
Sentry.IsContactLicenseOwner(int)
Sentry.IsContactCurrentDatabaseOwner(int)
Sentry.IsPersonAssociate(int, bool)
Sentry.IsAssociatesOwnerContact(int, int)
Sentry.Lookups
Sentry.Parent
Sentry.Registered
Sentry.RegisteredAssociateId
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public class SaleSentry : RoleRightsSentry<SaleTableInfo>, ICloneable
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Examples

SaleRow a = new SaleRow.IdxSaleId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

Constructors

SaleSentry(SaleTableInfo)

Create a Sale sentry.

Declaration
public SaleSentry(SaleTableInfo saleTableInfo)
Parameters
Type Name Description
SaleTableInfo saleTableInfo
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

SaleSentry(SaleTableInfo, QuoteTableInfo)

SaleSentry guards Sale entities and their component rows.

The SaleSentry applies to the following classes: Sale, SaleRow, TextRow, UDLarge + UDSmall

Declaration
public SaleSentry(SaleTableInfo saleTableInfo, QuoteTableInfo quoteTableInfo)
Parameters
Type Name Description
SaleTableInfo saleTableInfo
QuoteTableInfo quoteTableInfo
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Examples

SaleRow a = new SaleRow.IdxSaleId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

SaleSentry(SaleTableInfo, SaleStakeholderTableInfo)

SaleSentry guards Sale entities and their component rows.

The SaleSentry applies to the following classes: Sale, SaleRow, TextRow, UDLarge + UDSmall

Declaration
public SaleSentry(SaleTableInfo saleTableInfo, SaleStakeholderTableInfo saleStakeholderTableInfo)
Parameters
Type Name Description
SaleTableInfo saleTableInfo
SaleStakeholderTableInfo saleStakeholderTableInfo
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Examples

SaleRow a = new SaleRow.IdxSaleId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

SaleSentry(SaleTableInfo, SaleStakeholderTableInfo, QuoteTableInfo)

SaleSentry guards Sale entities and their component rows.

The SaleSentry applies to the following classes: Sale, SaleRow, TextRow, UDLarge + UDSmall

Declaration
public SaleSentry(SaleTableInfo saleTableInfo, SaleStakeholderTableInfo saleStakeholderTableInfo, QuoteTableInfo quoteTableInfo)
Parameters
Type Name Description
SaleTableInfo saleTableInfo
SaleStakeholderTableInfo saleStakeholderTableInfo
QuoteTableInfo quoteTableInfo
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Examples

SaleRow a = new SaleRow.IdxSaleId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

SaleSentry(SaleTableInfo, ISoDataLookup)

Create a Sale sentry for a particular Sale row. The row's associate_id will control the user's permissions with respect to this row.

Declaration
public SaleSentry(SaleTableInfo saleTableInfo, ISoDataLookup lookup)
Parameters
Type Name Description
SaleTableInfo saleTableInfo
ISoDataLookup lookup
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Properties

AssociateId

Sale.associate id

Declaration
public override int AssociateId { get; }
Property Value
Type Description
int
Overrides
Sentry.AssociateId
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

GroupId

returns Sale.GroupIdx

Declaration
public override int GroupId { get; }
Property Value
Type Description
int
Overrides
Sentry.GroupId
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

IsGhostRow

Returns whether the primary key is a ghost field (i.e., we're looking at a nonexistent record, as opposed to just looking at a new one)

Declaration
public override bool IsGhostRow { get; }
Property Value
Type Description
bool
Overrides
Sentry.IsGhostRow
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

IsNew

Is the row saved to teh database (persisted primary key == 0)

Declaration
public override bool IsNew { get; }
Property Value
Type Description
bool
Overrides
Sentry.IsNew
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

MainTable

Return Sale table info.

Declaration
protected SaleTableInfo MainTable { get; }
Property Value
Type Description
SaleTableInfo
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

RegisteredAssociateIdField

The field that holds the associate id of teh user first creating the item.

Declaration
public override FieldInfo RegisteredAssociateIdField { get; }
Property Value
Type Description
FieldInfo
Overrides
Sentry.RegisteredAssociateIdField
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

RegisteredField

The field that holds information about when the item was first created.

Declaration
public override FieldInfo RegisteredField { get; }
Property Value
Type Description
FieldInfo
Overrides
Sentry.RegisteredField
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

RowId

Should return a Sale.Sale_id

Declaration
public override int RowId { get; }
Property Value
Type Description
int
Overrides
Sentry.RowId
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Methods

ComputeDerivedTableRights()

Empty table copier function. Called after ComputeTableRights but before ComputeFieldRights. Default copy algorithm has been run, so the _tableRights array is fully populated. Gives sub-classes a chance to do their own funky thing. Publish and VisibleFor tables need to be handled

Declaration
protected override void ComputeDerivedTableRights()
Overrides
Sentry<SaleTableInfo>.ComputeDerivedTableRights()
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

ComputeFieldRights()

Computes the field rights based on the associate and group info in the row. The sub-class will handle its particular special cases here. This function is called from SuperComputeFieldRights() which does the standard calculations first, then allows this function to add any special restrictions afterwards.

This function computes a map of rights to all fields that can be determined, both on the primary table and any dependent tables. Each field has an entry in the map, which contains a bitwise OR of all rights the principal user has to that field. If the user has no update rights to a field, the corresponding GUI control should be read-only. If the user has no Read rights to a field, its value should not be shown at all. In the case of write but not read rights, the sanity of the underlying rules should be questioned.

Declaration
protected override void ComputeFieldRights()
Overrides
Sentry<SaleTableInfo>.ComputeFieldRights()
Remarks

Place the results of the computation in the _fieldRights member.

ComputeTableRights()

Computes table rights for Sale tables. Deny read rights to private Sales that belong to others. Deny update rights to completed Sales. Grant update+insert+delete rights to own Sales.

Declaration
protected override void ComputeTableRights()
Overrides
Sentry<SaleTableInfo>.ComputeTableRights()
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

GetRowSentry()

Create a copy of the Sentry holding the right instances of table and field infos.

Declaration
public override Sentry GetRowSentry()
Returns
Type Description
Sentry

New instance of the Sentry.

Overrides
Sentry.GetRowSentry()
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

GetTableInfoFromQuery<TargetTableInfo>()

Get tables of the given type from our query

Declaration
protected List<TargetTableInfo> GetTableInfoFromQuery<TargetTableInfo>() where TargetTableInfo : TableInfo
Returns
Type Description
List<TargetTableInfo>

List of tableinfos of the given type, from the query

Type Parameters
Name Description
TargetTableInfo

Type of table to look for

Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

_IsQuoteVersionLocked(QuoteVersionState)

SaleSentry guards Sale entities and their component rows.

The SaleSentry applies to the following classes: Sale, SaleRow, TextRow, UDLarge + UDSmall

Declaration
public static bool _IsQuoteVersionLocked(QuoteVersionState state)
Parameters
Type Name Description
QuoteVersionState state
Returns
Type Description
bool
Remarks

The Sale row automatically creates a sentry, because Sale is also an RDB Entity. The text row does not create a sentry because it does not know which entity it belongs to, so we have to give it a sentry to use. The text row asks the Sale sentry about its permissions.

Examples

SaleRow a = new SaleRow.IdxSaleId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

Implements

ICloneable

Extension Methods

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