Read portal security configuration¶
CheckOnlineSecurityAgreements and GetSpecialUserInfo both read OnlineProperties.xml through the shared clsProperties helper to answer two distinct portal-configuration questions — whether user-agreement checking is enabled, and what the special payroll-reporting-only credentials are. They are documented together because they share the same file, the same clsProperties access pattern, and similar defensive exception handling, even though they serve different callers.
| Field | Value |
|---|---|
| Operation ID | OP-SU-14 |
| Trigger | Caller calls clsSystemUser.CheckOnlineSecurityAgreements() to determine agreement-check policy, or GetSpecialUserInfo(specialUserName, specialUserId, utype) to resolve special-user credentials |
| Inputs | OnlineProperties.xml file path (resolved internally); for GetSpecialUserInfo, a specialUserType enum value (only payrollReportsOnly is defined) |
| Outputs | CheckOnlineSecurityAgreements: Boolean agreement-check flag; GetSpecialUserInfo: Boolean success flag plus by-reference specialUserName/specialUserId output parameters |
| Primary components | clsSystemUser.CheckOnlineSecurityAgreements(), clsSystemUser.GetSpecialUserInfo(...), clsSystemUser.GetPropFilePath(), clsProperties |
| Entry point | Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb; Legacy\SAIFProperties\clsProperties.vb |
Steps¶
- Agreement check — initialize to enabled.
CheckOnlineSecurityAgreementssetscheckEm = Trueas its default before any file access is attempted (BR-014). - Agreement check — resolve the configured XML path. A new
clsPropertiesinstance is created andprops.XMLPath()is read. - If the resolved path is empty: the method returns
True(the initialized default) immediately, inside the firstTryblock's own path. - On failure: an exception during path resolution causes the method to return
Falsefrom theCatchblock — the one case where the enabled default is explicitly overridden before the file is even located (BR-014). - The
clsPropertiesinstance is disposed in theFinallyblock of this firstTry. - Agreement check — read the file if it exists. A second
Tryblock checksSystem.IO.File.Exists(checkPath & "OnlineProperties.xml"). - If the file exists: a new
clsProperties(OnlineProperties.xml, checkPath)is opened andgetAppProperties("CHECK_FOR_USER_AGREEMENTS")is read.- If the node is missing (
Nothing):checkEmis set toFalse(BR-014). - If the node is present but its trimmed, upper-cased text has length
0:checkEmremainsTrue(the default is preserved). - If the node's text is non-empty:
checkEmis set by casting that text toBoolean, so the file's explicit value directly determines the outcome.
- If the node is missing (
- If the file does not exist at all:
checkEmremains at its initializedTruevalue — no override occurs. - On any exception while reading or parsing the file:
checkEmis set toFalsein theCatchblock (BR-014). - The
clsPropertiesinstance (if created) is disposed in theFinallyblock. - Agreement check — return the result. The method returns
checkEm. - Special-user info — resolve the property-file path.
GetSpecialUserInfocallsGetPropFilePath(), which reads the current web request'sAPPL_PHYSICAL_PATHserver variable, walks up to the parent directory, and appends anXMLsubfolder to build the target path — a different path-resolution strategy than theclsProperties.XMLPath()call used by the agreement check.* - Special-user info — select the node address. The method maps the
specialUserTypeenum to a node path underSPECIAL_USERS/; onlypayrollReportsOnlyis defined, which maps toSPECIAL_USERS/PAYROLL_REPORTING_ONLY. Other enum values (none currently exist) would fall through theCase Elsewith no node suffix appended. - Special-user info — read the file if it exists. If
OnlineProperties.xmlexists at the resolved path, aclsPropertiesinstance opens it and reads the mapped node. - If the node is found:
specialUserNameandspecialUserId(by-reference output parameters) are populated from the node'sNAMEandIDchild elements. - If the node is not found:
successis set toFalse. - If the file does not exist: the method falls through without setting
successtoFalseexplicitly, so it remains at its initializedTruevalue even though no output values were populated.* - Special-user info — handle exceptions. Any exception while reading or parsing the file sets
success = Falsein theCatchblock; theFinallyblock disposes theclsPropertiesinstance if one was created. - Special-user info — return the result. The method returns
success, withspecialUserName/specialUserIdpopulated only when a matching node was actually found.
Process flow¶
The following diagram visualizes this operation's control flow across both entry points.
flowchart TD
Start([Caller invokes CheckOnlineSecurityAgreements or GetSpecialUserInfo]) --> Which{Which entry point?}
Which -->|Agreement check| InitTrue[checkEm = True]
InitTrue --> ResolvePath[Resolve XMLPath via clsProperties]
ResolvePath --> PathEmpty{Path empty?}
PathEmpty -->|Yes| ReturnTrue([Return True])
PathEmpty -.exception.-> ReturnFalsePath([Return False])
PathEmpty -->|No| FileExists{OnlineProperties.xml exists?}
FileExists -->|No| ReturnDefault([Return checkEm - still True])
FileExists -->|Yes| ReadNode[Read CHECK_FOR_USER_AGREEMENTS node]
ReadNode --> NodeMissing{Node missing?}
NodeMissing -->|Yes| SetFalse[checkEm = False]
NodeMissing -->|No| TextEmpty{Node text empty?}
TextEmpty -->|Yes| KeepTrue[checkEm stays True]
TextEmpty -->|No| ParseBool[checkEm = CBool node text]
ReadNode -.exception.-> SetFalse
SetFalse --> ReturnResult([Return checkEm])
KeepTrue --> ReturnResult
ParseBool --> ReturnResult
Which -->|Special user info| ResolveXmlDir[GetPropFilePath: derive XML folder from web request path]
ResolveXmlDir --> MapType[Map specialUserType to node address]
MapType --> FileExists2{OnlineProperties.xml exists?}
FileExists2 -->|No| ReturnSuccessDefault([Return success - still True, no values set])
FileExists2 -->|Yes| ReadNode2[Read mapped SPECIAL_USERS node]
ReadNode2 --> NodeFound{Node found?}
NodeFound -->|Yes| Populate[Populate specialUserName and specialUserId]
NodeFound -->|No| SetFalse2[success = False]
ReadNode2 -.exception.-> SetFalse2
Populate --> ReturnSuccess([Return success])
SetFalse2 --> ReturnSuccess
Failure and edge-case behavior¶
- The agreement check treats a missing configured path, a missing file, and a present-but-empty node as equivalent to "checking is enabled," while only a path-resolution exception, a missing expected node, or a read/parse exception disable it — the disable conditions are the exception, not the rule (BR-014).
GetSpecialUserInfouses a completely different path-resolution strategy (GetPropFilePath(), based on the current web request) than the agreement check (clsProperties.XMLPath()), so the two flows can end up readingOnlineProperties.xmlfrom different resolved locations in the same running application.*- When
OnlineProperties.xmldoes not exist at all,GetSpecialUserInforeturnssuccess = Truewithout ever populatingspecialUserName/specialUserId— callers must not assume aTrueresult means the output parameters were actually set.* GetPropFilePath()depends onSystem.Web.HttpContext.Currentbeing available, so callingGetSpecialUserInfooutside an active web request context would fail at that step.*
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Business\SAIF.Business.Security.SystemUser\clsSystemUser.vbLegacy\SAIFProperties\clsProperties.vb