Class VisibleForSentryHelper
Helper class for sentry functionality, to modify SELECT queries so that they include the correct join and restriction
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public static class VisibleForSentryHelper
Methods
GetVisibleForRestriction(VisibleForTableInfo)
Get the VisibleFor restriction clause, checking for access via forAll, forGroupId and forAssociateId
Declaration
public static Restriction GetVisibleForRestriction(VisibleForTableInfo v)
Parameters
Type | Name | Description |
---|---|---|
VisibleForTableInfo | v |
Returns
Type | Description |
---|---|
Restriction |
Remarks
The group id check includes both the primary and all secondary user groups the current associate is a member of
JoinVisibleFor(Select, TableInfo)
Modify the given query by adding the join to VisibleFor, with the proper restrictions
Declaration
public static void JoinVisibleFor(Select sql, TableInfo mainTable)
Parameters
Type | Name | Description |
---|---|---|
Select | sql | Query to modify |
TableInfo | mainTable | Main table of query |
Remarks
If a join to VisibleFor is not required for the given table, nothing happens. If a join already exists in the query, and is an outer join, then it is upgraded to an inner join. If restrictions should be set up-front for filtering for this main table, that is done.
Important note - if the main table is itself an outer-joined table, then any joins created here will also be left-outer (and existing ones will not be changed to inner), as that would break the original left outer join and make it behave like an inner. Sorry, that is how SQL works.