Show / Hide Table of Contents

Class TicketSentry

TicketSentry guards Ticket entities and their component rows.

The TicketSentry applies to the following classes: Ticket, TicketRow, TextRow, UDLarge + UDSmall

Inheritance
object
Sentry
Sentry<TicketTableInfo>
TicketSentry
Implements
ICloneable
Inherited Members
Sentry<TicketTableInfo>.GetInterestingFieldsInTable(TableInfo)
Sentry<TicketTableInfo>.InterestedInAnyInstanceOf<T>()
Sentry<TicketTableInfo>.SuperComputeDerivedTableRights()
Sentry<TicketTableInfo>.ComputeDerivedTableRight(TableRight)
Sentry<TicketTableInfo>.SuperComputeTableRights()
Sentry<TicketTableInfo>.AddInterestingTables(params TableInfo[])
Sentry<TicketTableInfo>.ComputeLicenseExpiration()
Sentry<TicketTableInfo>.SuperComputeFieldRights()
Sentry<TicketTableInfo>.CanCoverTable(TableInfo)
Sentry<TicketTableInfo>.IsTableCovered(TableInfo)
Sentry<TicketTableInfo>.SetAllTableRights(ETableRight, string)
Sentry<TicketTableInfo>.GetOwnerFieldRight()
Sentry<TicketTableInfo>.GetMainRight()
Sentry<TicketTableInfo>.AnalyzeQuery(PrivateSelect)
Sentry<TicketTableInfo>.ToString()
Sentry<TicketTableInfo>.InterestingFields
Sentry<TicketTableInfo>.SentryQueryInfo
Sentry<TicketTableInfo>.MainTable
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
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 TicketSentry : Sentry<TicketTableInfo>, ICloneable
Remarks

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

Examples

TicketRow a = new TicketRow.IdxTicketId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );

Constructors

TicketSentry(TicketTableInfo)

Create a Ticket sentry.

Declaration
public TicketSentry(TicketTableInfo ticketTableInfo)
Parameters
Type Name Description
TicketTableInfo ticketTableInfo
Remarks

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

TicketSentry(TicketTableInfo, ISoDataLookup)

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

Declaration
public TicketSentry(TicketTableInfo ticketTableInfo, ISoDataLookup lookup)
Parameters
Type Name Description
TicketTableInfo ticketTableInfo
ISoDataLookup lookup
Remarks

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

Properties

AssociateId

Ticket.ownedBy.associate id

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

GroupId

returns Ticket.ownedBy.associate.GroupIdx

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket 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 Ticket row automatically creates a sentry, because Ticket 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 Ticket 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 Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

RegisteredAssociateId

Who created the item.

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

RegisteredAssociateIdField

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

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket 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 Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

RowId

Should return a Ticket.Ticket_id

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

Methods

ComputeDerivedTableRights()

Set correct rights on derived tables (tables we're responsible for, that are not the ticket table)

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

The Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

ComputeFieldRights()

Any special field right calculations go here

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

If we ever decide that ej_message:None means that ticket.numMessages should be masked, then this is the place to do that

ComputeTableRights()

Computes table rights for Ticket tables.

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

The actual rights impact the ticket and ej_message tables, primarily. The rights calculations are performed three times to catch the differences between List/View/Edit intents (a concept unusual to NetServer); those results are then mapped onto table rights

EvaluateTicketRights(TableRight, int, int, int, DateTime, int, TicketIntent)

The ticket rights calculation, available as a static method, with selectable intent. Sentry looks at all three and maps them to table rights

Declaration
public static (ETableRight right, string reason) EvaluateTicketRights(TableRight initialRight, int rowid, int ownedBy, int category, DateTime createdAt, int createdBy, TicketSentry.TicketIntent intent = TicketIntent.List)
Parameters
Type Name Description
TableRight initialRight

Rights from previous evaluations, for instance the standard Sentry, or just Full

int rowid

Primary key of ticket row

int ownedBy

OwnedBy field of ticket row (ejuser, magic value 1 if unassigned)

int category

Category of ticket row

DateTime createdAt
int createdBy
TicketSentry.TicketIntent intent

What is the intended use, which affects the calculations

Returns
Type Description
(ETableRight right, string reason)
Remarks

The Ticket row automatically creates a sentry, because Ticket 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 Ticket 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 Ticket row automatically creates a sentry, because Ticket 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 Ticket 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 Ticket row automatically creates a sentry, because Ticket 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 Ticket sentry about its permissions.

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