Class Sentry<TMainTable>
Summary description for Sentry.
Inheritance
Implements
Inherited Members
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
CanCoverTable(TableInfo)
Summary description for Sentry.
Declaration
public override bool CanCoverTable(TableInfo table)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | table |
Returns
Type | Description |
---|---|
bool |
Overrides
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 current 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
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
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
SuperComputeDerivedTableRights()
Summary description for Sentry.
Declaration
protected override void SuperComputeDerivedTableRights()
Overrides
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
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
ToString()
Summary description for Sentry.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |