Class AssociateSentry
Implements
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public class AssociateSentry : Sentry<AssociateTableInfo>, ICloneable
Constructors
AssociateSentry(AssociateTableInfo)
Create a contact sentry.
Declaration
public AssociateSentry(AssociateTableInfo associateTableInfo)
Parameters
Type | Name | Description |
---|---|---|
AssociateTableInfo | associateTableInfo |
AssociateSentry(AssociateTableInfo, ISoDataLookup)
Create a contact sentry for a particular contact row. The row's associate_id will control the user's permissions with respect to this row.
Declaration
public AssociateSentry(AssociateTableInfo associateTableInfo, ISoDataLookup lookup)
Parameters
Type | Name | Description |
---|---|---|
AssociateTableInfo | associateTableInfo | |
ISoDataLookup | lookup |
Properties
AssociateId
Returns the associate id based on the row provided to the sentry. This method must be overridden by the sub-class.
Declaration
public override int AssociateId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
IsGhostRow
Returns whether the primary key field is a ghost
Declaration
public override bool IsGhostRow { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
IsNew
Is the row saved to teh database (persisted primary key == 0)
Declaration
public override bool IsNew { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
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
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
RowId
Returns the primary key id based on the row provided to the sentry. This method must be overridden by the sub-class.
Declaration
public override int RowId { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
UserType
Declaration
public UserType UserType { get; }
Property Value
Type | Description |
---|---|
UserType |
Methods
CanPrincipalManage(UserType)
Can the logged in user manage user of type.
Declaration
public static bool CanPrincipalManage(UserType userType)
Parameters
Type | Name | Description |
---|---|---|
UserType | userType | User type to check if the user can manage |
Returns
Type | Description |
---|---|
bool | True if the logged in user can manage the specified user type. |
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
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.
ComputeLicenseExpiration()
Declaration
protected override void ComputeLicenseExpiration()
Overrides
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 override void ComputeTableRights()
Overrides
Remarks
Leave the result of the computation in the _tableRights member.
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. |