Skip to content

ISecurityService

Contract for the user and access questions BOL pages ask: who the user is, whether they are external, whether they hold a role, and whether they may view a policy. SecurityService implements it.

Purpose

Context

  • Namespace: BolMiddleware.Services.Security
  • Assembly/package: BolMiddleware

Public members

Member Signature Purpose
GetCurrentUserId string? GetCurrentUserId() Returns the authenticated identity name.
IsAuthorizedAsync Task<bool> IsAuthorizedAsync(string role) Tells whether the current user holds the given role.
IsUserExternal bool IsUserExternal() True when the user is not on the internal SAIF domain.
GetCurrentExternalUserAsync Task<ExternalUser> GetCurrentExternalUserAsync() Fetches the external user record through ISecurityClient.GetExternalUser.
IsValidPolicyForCurrentUser Task<bool> IsValidPolicyForCurrentUser(long policyNumber) Tells whether the user may view the policy.

Behavioral notes

  • Two callers block on the async members with Task.Result.

Constraints and usage notes

  • Registered as scoped.

Sources

  • src/BolMiddleware/Services/Security/ISecurityService.cs