Class PlatformAdminVerifierAdapter
- Namespace
- KadicAuth.Infrastructure.Services
- Assembly
- KadicAuth.Infrastructure.dll
Thin adapter so modules that only depend on KadicErp.Core.Abstractions (RentACar, Purchase, etc. — never KadicAuth.Application) can still get a live-verified platform-admin check without taking on a hard reference to the Auth module's application layer. There is exactly one source of truth for platform-admin membership: IPlatformAdminService.
public sealed class PlatformAdminVerifierAdapter : IPlatformAdminVerifier
- Inheritance
-
objectPlatformAdminVerifierAdapter
- Implements
-
IPlatformAdminVerifier
Constructors
PlatformAdminVerifierAdapter(IPlatformAdminService)
public PlatformAdminVerifierAdapter(IPlatformAdminService platformAdminService)
Parameters
platformAdminServiceIPlatformAdminService
Methods
IsPlatformAdminAsync(Guid, CancellationToken)
Short-cached DB re-check. Callers MUST invoke this on every
cross-tenant/cross-branch bypass — never trust the JWT hint
(ICurrentUser.IsPlatformAdmin) alone — so that a revoked
platform admin loses the bypass within seconds, not the lifetime of
their JWT.
public Task<bool> IsPlatformAdminAsync(Guid userId, CancellationToken cancellationToken = default)
Parameters
userIdGuidcancellationTokenCancellationToken
Returns
- Task<bool>