Show / Hide Table of Contents

Class Sentry<TMainTable>

Summary description for Sentry.

Inheritance
object
Sentry
Sentry<TMainTable>
AssociateSentry
DocDocumentSentry
HierarchySentry
KbEntrySentry
QuoteAlternativeSentry
QuoteLineSentry
QuoteSentry
QuoteVersionSentry
ReplyTemplateSentry
RoleRightsSentry<TMainTable>
SORPublishSentry
SatelliteSentry
TicketSentry
UDefFieldSentry
WorkflowSentry
Implements
ICloneable
Inherited Members
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.GetRowSentry()
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.RegisteredField
Sentry.RegisteredAssociateIdField
Sentry.RowId
Sentry.IsNew
Sentry.IsGhostRow
Sentry.Registered
Sentry.RegisteredAssociateId
Sentry.AssociateId
Sentry.GroupId
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 abstract class Sentry<TMainTable> : Sentry, ICloneable where TMainTable : TableInfo
Type Parameters
Name Description
TMainTable

Constructors

Sentry(SentryQueryInfo<TMainTable>)

Hidden constructor. This is an abstract class after all.

Declaration
protected Sentry(SentryQueryInfo<TMainTable> coveredTables)
Parameters
Type Name Description
SentryQueryInfo<TMainTable> coveredTables

Properties

InterestingFields

Summary description for Sentry.

Declaration
protected Dictionary<TableInfo, HashSet<FieldInfo>> InterestingFields { get; }
Property Value
Type Description
Dictionary<TableInfo, HashSet<FieldInfo>>

MainTable

Get main table for the sentry.

Declaration
public TMainTable MainTable { get; }
Property Value
Type Description
TMainTable

SentryQueryInfo

Returns an array of the table-ids of the tables this sentry covers

Declaration
public SentryQueryInfo<TMainTable> SentryQueryInfo { get; }
Property Value
Type Description
SentryQueryInfo<TMainTable>

Methods

AddInterestingTables(params TableInfo[])

Summary description for Sentry.

Declaration
protected void AddInterestingTables(params TableInfo[] tables)
Parameters
Type Name Description
TableInfo[] tables

AnalyzeQuery(PrivateSelect)

Summary description for Sentry.

Declaration
public override void AnalyzeQuery(PrivateSelect sql)
Parameters
Type Name Description
PrivateSelect sql
Overrides
Sentry.AnalyzeQuery(PrivateSelect)

CanCoverTable(TableInfo)

Summary description for Sentry.

Declaration
public override bool CanCoverTable(TableInfo table)
Parameters
Type Name Description
TableInfo table
Returns
Type Description
bool
Overrides
Sentry.CanCoverTable(TableInfo)

ComputeDerivedTableRight(TableRight)

Summary description for Sentry.

Declaration
protected TableRight ComputeDerivedTableRight(TableRight mainRight)
Parameters
Type Name Description
TableRight mainRight
Returns
Type Description
TableRight

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 virtual void ComputeDerivedTableRights()

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 abstract void ComputeFieldRights()
Remarks

Place the results of the computation in the _fieldRights member.

ComputeLicenseExpiration()

Summary description for Sentry.

Declaration
protected virtual void ComputeLicenseExpiration()

ComputeTableRights()

Computes the table 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 SuperComputeTableRights() which does the standard calculations first, then allows this function to add any special restrictions afterwards.

Declaration
protected abstract void ComputeTableRights()
Remarks

Leave the result of the computation in the _tableRights member.

GetInterestingFieldsInTable(TableInfo)

Summary description for Sentry.

Declaration
protected HashSet<FieldInfo> GetInterestingFieldsInTable(TableInfo tableInfo)
Parameters
Type Name Description
TableInfo tableInfo
Returns
Type Description
HashSet<FieldInfo>

GetMainRight()

Get the main table right for this entity.

Declaration
public override ETableRight GetMainRight()
Returns
Type Description
ETableRight

Main table right for this entity

Overrides
Sentry.GetMainRight()

GetOwnerFieldRight()

Get field rights for the fields that refers to this primary key.

Declaration
public virtual EFieldRight GetOwnerFieldRight()
Returns
Type Description
EFieldRight

Field rights of fields refering to this primary key.

InterestedInAnyInstanceOf<T>()

Summary description for Sentry.

Declaration
protected bool InterestedInAnyInstanceOf<T>() where T : TableInfo
Returns
Type Description
bool
Type Parameters
Name Description
T

IsTableCovered(TableInfo)

Returns true if the sentry has an opinion about the table in question.

Declaration
public override bool IsTableCovered(TableInfo table)
Parameters
Type Name Description
TableInfo table
Returns
Type Description
bool
Overrides
Sentry.IsTableCovered(TableInfo)

SetAllTableRights(ETableRight, string)

Copies the given right and reason into all the tablerights, except for the main table. The main table can have different rights than the dependent tables.

Declaration
protected override void SetAllTableRights(ETableRight right, string reason)
Parameters
Type Name Description
ETableRight right
string reason
Overrides
Sentry.SetAllTableRights(ETableRight, string)

SuperComputeDerivedTableRights()

Summary description for Sentry.

Declaration
protected override void SuperComputeDerivedTableRights()
Overrides
Sentry.SuperComputeDerivedTableRights()

SuperComputeFieldRights()

Computes the standard field rights based on the record's ownership index. Bases its work on the computed table rights. Called by the sub-class's ComputeFieldRights method.

Declaration
protected override void SuperComputeFieldRights()
Overrides
Sentry.SuperComputeFieldRights()

SuperComputeTableRights()

Computes the standard table rights based on the record's ownership index. Called by the sub-class's ComputeTableRights method.

Declaration
protected override void SuperComputeTableRights()
Overrides
Sentry.SuperComputeTableRights()

ToString()

Summary description for Sentry.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

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