Skip to content

clsPolicySecurity

clsPolicySecurity is the central authorization class in this library: it determines whether the current clsSecurityPrincipal may view a given policy (Determine whether the current user may view a policy) and produces the "policy list" (book of business) for agents, policyholders, groups, loss-control consultants, and fee auditors (Build the current user's book of business). Unlike most other types in this library, it is a plain class, not a clsBusinessBase derivative.

Purpose

  • Enforces per-user-type policy access rules (BR-VP-002 through BR-VP-009).
  • Builds the "book of business" policy list for the current user, dispatching by user type to different SQL Server, Oracle, or in-memory sources.
  • Constructs and owns a secondary SQL Server "BDS" IDataPortalInfo connection, distinct from the caller-supplied primary DPI, used exclusively for group/loss-control/agent authorization lookups.

Context

  • Namespace: SAIF.Business.View.Policy
  • Assembly/package: SAIF.Business.View.Policy (embedded library reference)

Public members

Member Signature Purpose
New Sub New(inSecurityPrincipal As clsSecurityPrincipal, inDPI As IDataPortalInfo) Constructs the security manager, deriving a clsUserType and initializing the secondary SQL Server BDS connection.
IsPolicyValidForUser Function IsPolicyValidForUser(inPolicyData As clsPolicyData) As Boolean The core authorization entry point (Determine whether the current user may view a policy).
IsPolicyValidForUser Function IsPolicyValidForUser(inPolicyNum As Decimal) As Boolean Convenience overload that loads the policy header before delegating to the object overload.
IsPolicyValidForParentPolicy Function IsPolicyValidForParentPolicy(inPolicyNum As Decimal) As Boolean Policyholder-specific ownership/parent-affiliation check (BR-VP-006).
IsInGroup Function IsInGroup(...) As Boolean Group-membership check via SQL-VP-033.
CanSafetyConsultantAccessPolicy Function CanSafetyConsultantAccessPolicy(...) As Boolean Loss-control consultant team-assignment match check.
CanAuditorAccessPolicy Function CanAuditorAccessPolicy(...) As Boolean Fee-auditor vendor/audit-record match check via SQL-VP-037.
PolicyList ReadOnly Property PolicyList As List(Of strPolicyList) Lazily builds and caches the current user's book of business (Build the current user's book of business).
GetPolicyListForAgent Function GetPolicyListForAgent(...) As List(Of strPolicyList) Agent book-of-business builder via SQL-VP-036.
GetPolicyListforGroup Function GetPolicyListforGroup() As List(Of strPolicyList) Group book-of-business builder via SQL-VP-034.
GetPolicyListForSafetyConsultant Function GetPolicyListForSafetyConsultant(...) As List(Of strPolicyList) Loss-control book-of-business builder via SQL-VP-035.
GetPolicyListForFeeAuditor Function GetPolicyListForFeeAuditor(...) As List(Of strPolicyList) Fee-auditor book-of-business builder via SQL-VP-038.
DPISql ReadOnly Property DPISql As IDataPortalInfo The internally-constructed secondary SQL Server BDS connection.

Behavioral notes

  • Not a clsBusinessBase derivative — this class has no inherited members from saif.framework.core's business-object base classes.
  • Any user type not matched by the IsPolicyValidForUser Select Case falls through to an implicit deny (hasAccess remains False).*
  • The PolicyList property has no dispatch case for SaifEmployee/MCO/MedProv/Bookkeeper; these user types do not receive a book-of-business list from this property.*

Constraints and usage notes

  • The secondary SQL Server BDS connection is built from three Environment API settings (BDS_USER, bdsDatabase, BDS_DATABASENAME) read once per instance in Initialize() (Configuration settings).
  • PolicyList results are cached for the lifetime of the clsPolicySecurity instance; construct a new instance to force a re-query.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Business.View.Policy\clsPolicySecurity.vb