Show / Hide Table of Contents

Class PersonSentry

PersonSentry guards Person entities and their component rows. The PersonSentry applies to the following classes: Person, PersonRow, AddressRow, PhoneRow, EmailRow, UrlRow, InterestRows, UdefLarge and UdefSmall

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

Examples

PersonRow p = new PersonRow.IdxPersonId(1234); TextRow t = new TextRow.IdxTextId( c.TextId ); t.Sentries.Add( p.Sentries );

Constructors

PersonSentry(PersonTableInfo)

Create a Person sentry.

Declaration
public PersonSentry(PersonTableInfo personTableInfo)
Parameters
Type Name Description
PersonTableInfo personTableInfo

Instance of TableInfo for the person that the sentry represents.

Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

PersonSentry(PersonTableInfo, ContactTableInfo)

Create a Person sentry.

Declaration
public PersonSentry(PersonTableInfo personTableInfo, ContactTableInfo contactTableInfo)
Parameters
Type Name Description
PersonTableInfo personTableInfo

Instance of TableInfo for the person that the sentry represents.

ContactTableInfo contactTableInfo

Instance of TableInfo used to get additional fields from the contact.

Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

PersonSentry(PersonTableInfo, ISoDataLookup)

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

Declaration
public PersonSentry(PersonTableInfo personTableInfo, ISoDataLookup lookup)
Parameters
Type Name Description
PersonTableInfo personTableInfo

Instance of TableInfo for the person that the sentry represents.

ISoDataLookup lookup
Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

Properties

AssociateId

Person's associate id - returns the person's associate id if it is defined. If the person.associd = 0, then it returns the contact.associd - which should have been added to the query Returns the current user's id if the record contains 0.

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

ContactTableInfo

TableInfo for the contact table related to the person's contactId.

Declaration
public ContactTableInfo ContactTableInfo { get; set; }
Property Value
Type Description
ContactTableInfo
Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

GroupId

Person's Group id. Returns the Contact.GroupId if Person.GroupId = 0. Returns the associate's GroupId if Contact.GroupId = 0 as well.

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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 Person row automatically creates a sentry, because Person 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 will ask the Person sentry about its permissions.

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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 Person row automatically creates a sentry, because Person 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 will ask the Person sentry about its permissions.

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

MainTable

Return Person table info.

Declaration
protected PersonTableInfo MainTable { get; }
Property Value
Type Description
PersonTableInfo
Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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 Person row automatically creates a sentry, because Person 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 will ask the Person sentry about its permissions.

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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 Person row automatically creates a sentry, because Person 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 will ask the Person sentry about its permissions.

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

RowId

Should return a Person.Person_id

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

Methods

ComputeFieldRights()

Remove write rights to retired field if person is an associate.

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

ComputeTableRights()

Computes table rights for Person tables. Deny delete to Persons which are associates.

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

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

GetRowSentry()

Get a copy of the Sentry holding the same field and table infos.

Declaration
public override Sentry GetRowSentry()
Returns
Type Description
Sentry

Copy of the sentry.

Overrides
Sentry.GetRowSentry()
Remarks

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

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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 Person row automatically creates a sentry, because Person 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 will ask the Person sentry about its permissions.

The person sentry uses the person.associate/group fields to determine ownership. If these fields are zero, then the person's contact is used to determine the owner.

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