Class SentryQueryUpdater
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public sealed class SentryQueryUpdater : Object, IQueryProcessorPlugin
Constructors
SentryQueryUpdater(SoCommand)
Create a new sentry filter for the command.
Declaration
public SentryQueryUpdater(SoCommand socommand)
Parameters
Type | Name | Description |
---|---|---|
SoCommand | socommand | Command object with Sentries and the IsAutoSentry property. |
Methods
AfterCommit()
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterCommit()
AfterCommitOrAutoCommit()
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterCommitOrAutoCommit()
AfterExecute(SqlCommand, SqlCommand, Int32)
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterExecute(SqlCommand orgCommand, SqlCommand command, int rowsAffected)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | |
SqlCommand | command | |
Int32 | rowsAffected |
AfterExecuteFailed(SqlCommand, SqlCommand)
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterExecuteFailed(SqlCommand orgCommand, SqlCommand command)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | |
SqlCommand | command |
AfterGenerate(SqlCommand, SqlCommand)
Add sentries to command
Declaration
public void AfterGenerate(SqlCommand orgCommand, SqlCommand command)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | Original Query object. May be a BatchSave, a Row object or a simple Select, Update, Delete, etc |
SqlCommand | command | Query to be processed. May be BatchSave, Union, simple Select, Update, Delete, etc |
AfterRead(SoCommand, SoDataReader, ref Boolean)
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterRead(SoCommand command, SoDataReader reader, ref bool skipRow)
Parameters
Type | Name | Description |
---|---|---|
SoCommand | command | |
SoDataReader | reader | |
Boolean | skipRow |
AfterRollback()
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void AfterRollback()
BeforeExecute(SqlCommand, SqlCommand)
Check the sentries to see if we are allowed to do what we are trying to do.
Declaration
public void BeforeExecute(SqlCommand orgCommand, SqlCommand command)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | Original Query object. May be a BatchSave, a Row object or a simple Select, Update, Delete, etc |
SqlCommand | command | Query to be processed. May be BatchSave, Union, simple Select, Update, Delete, etc |
BeforeGenerate(SqlCommand, SqlCommand)
Modifies SELECT queries according to the fields used in the query. For example, if a person row is being read, then a contact row will be outer-joined to provide the contact.associate-id for the sentry. If the appointment table is being searched, then the appointment table is inner-joined with the visible-for table to filter out any hidden/private appointments.
The query updater will analyze the query and automatically add the sentries it considers relevant to the query unless the SoCommand.IsAutoSentry flag is cleared. The query updater uses the sentries attached to the query to modify the query to ensure that all the right fields and restrictions are in place. This ensures that private or unpublished data is filtered out on the server. This plug-in will also throw an SoSentryException if an update violates a sentry's rules.Declaration
public void BeforeGenerate(SqlCommand orgCommand, SqlCommand command)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | |
SqlCommand | command |
InitialTransform(SqlCommand, ref SqlCommand)
Handle the BeforeGenerate event, unwind batches and call the template method OnBeforeGenerate, supplied by the derived class.
Declaration
public void InitialTransform(SqlCommand orgCommand, ref SqlCommand command)
Parameters
Type | Name | Description |
---|---|---|
SqlCommand | orgCommand | Original Query object. May be a BatchSave, a Row object or a simple Select, Update, Delete, etc |
SqlCommand | command | Query to be processed. May be BatchSave, Union, simple Select, Update, Delete, etc |