Interface IImpersonationService
Interface for user impersonation functionality.
public interface IImpersonationService
Properties
ImpersonatedUserId
Gets the impersonated user ID if impersonating, null otherwise.
int? ImpersonatedUserId { get; }
Property Value
- int?
IsImpersonating
Checks if the current session is an impersonation session.
bool IsImpersonating { get; }
Property Value
OriginalAdminId
Gets the original admin user ID if impersonating, null otherwise.
int? OriginalAdminId { get; }
Property Value
- int?
Methods
StartImpersonationAsync(int, int)
Starts impersonating a user. Stores the original admin ID in session.
Task<bool> StartImpersonationAsync(int adminUserId, int targetUserId)
Parameters
Returns
StopImpersonationAsync()
Stops impersonation and restores the original admin session.
Task<bool> StopImpersonationAsync()