Validate user ID format¶
IsValidUserID mirrors Validate password format structurally — same default bounds, same disallowed-character pattern — but is applied to candidate user IDs rather than passwords. It is documented as its own operation because it validates a distinct entity (user ID) governed by its own business rule, even though the implementation logic is duplicated from the password check.
| Field | Value |
|---|---|
| Operation ID | OP-SU-13 |
| Trigger | Caller calls clsSystemUser.IsValidUserID(inUserid, [inMinLength], [inMaxLength]) |
| Inputs | inUserid candidate user ID; optional inMinLength (default 5); optional inMaxLength (default 20) |
| Outputs | Boolean result |
| Primary components | clsSystemUser.IsValidUserID(...) |
| Entry point | Business\SAIF.Business.Security.SystemUser\clsSystemUser.vb |
Steps¶
- Start valid.
isValidis initialized toTrue. - Check the maximum length. If
Len(inUserid) > inMaxLength,isValidis set toFalse(BR-008). - Check the minimum length. Otherwise, if
Len(inUserid) < inMinLength,isValidis set toFalse(BR-008). - Check for disallowed characters. Independent of the length checks,
inUserid Like BADCHARSis evaluated against the same pattern used by Validate password format; a match setsisValid = False(BR-008). - Return the result. The final
isValidvalue is returned.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller calls IsValidUserID]) --> Init[isValid = True]
Init --> MaxLen{Len exceeds inMaxLength?}
MaxLen -->|Yes| Invalid[isValid = False]
MaxLen -->|No| MinLen{Len below inMinLength?}
MinLen -->|Yes| Invalid
MinLen -->|No| CharCheck
Invalid --> CharCheck{Matches BADCHARS pattern?}
CharCheck -->|Yes| InvalidChars[isValid = False]
CharCheck -->|No| Return([Return isValid])
InvalidChars --> Return
Failure and edge-case behavior¶
- Because the same default bounds (5–20) and character pattern are reused from password validation, any future change to password rules that is not mirrored here would silently diverge the two checks — the logic is duplicated, not shared.*
- As with password validation, the method does not indicate which specific check (length or characters) caused a
Falseresult.
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.vb