Table of Contents

Interface IImpersonationService

Namespace
Ando.Server.Services
Assembly
Ando.Server.dll

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

bool

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

adminUserId int
targetUserId int

Returns

Task<bool>

StopImpersonationAsync()

Stops impersonation and restores the original admin session.

Task<bool> StopImpersonationAsync()

Returns

Task<bool>