Class ReplyTemplateSentry
ReplyTemplateSentry guards ReplyTemplate entities and their component rows.
The ReplyTemplateSentry applies to the following classes: ReplyTemplate, ReplyTemplateRow, TextRow, UDLarge + UDSmall
Implements
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public class ReplyTemplateSentry : Sentry<ReplyTemplateTableInfo>, ICloneable
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
Examples
ReplyTemplateRow a = new ReplyTemplateRow.IdxReplyTemplateId(1234); TextRow t = new TextRow.IdxTextId( a.TextId, a.Sentries );
Constructors
ReplyTemplateSentry(ReplyTemplateTableInfo)
Create a ReplyTemplate sentry.
Declaration
public ReplyTemplateSentry(ReplyTemplateTableInfo replyTemplateTableInfo)
Parameters
Type | Name | Description |
---|---|---|
ReplyTemplateTableInfo | replyTemplateTableInfo |
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
ReplyTemplateSentry(ReplyTemplateTableInfo, ISoDataLookup)
Create a ReplyTemplate sentry for a particular ReplyTemplate row. The row's associate_id will control the user's permissions with respect to this row.
Declaration
public ReplyTemplateSentry(ReplyTemplateTableInfo replyTemplateTableInfo, ISoDataLookup lookup)
Parameters
Type | Name | Description |
---|---|---|
ReplyTemplateTableInfo | replyTemplateTableInfo | |
ISoDataLookup | lookup |
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
Properties
AssociateId
ReplyTemplate.associate id
Declaration
public override int AssociateId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
GroupId
returns ReplyTemplate.GroupIdx
Declaration
public override int GroupId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
RegisteredAssociateId
Who created the item.
Declaration
public override int RegisteredAssociateId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
RowId
Should return a ReplyTemplate.ReplyTemplate_id
Declaration
public override int RowId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.
Methods
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 override void ComputeFieldRights()
Overrides
Remarks
Place the results of the computation in the _fieldRights member.
ComputeTableRights()
Computes table rights for ReplyTemplate tables. Deny read rights to private ReplyTemplates that belong to others. Deny update rights to completed ReplyTemplates. Grant update+insert+delete rights to own ReplyTemplates.
Declaration
protected override void ComputeTableRights()
Overrides
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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
Remarks
The ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate 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 ReplyTemplate row automatically creates a sentry, because ReplyTemplate 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 ReplyTemplate sentry about its permissions.