Skip to content

ImpersonatingUserAccessor class

namespace: Serenity.Web   assemblySerenity.Net.Core

Wraps an IUserAccessor and adds support for temporary user impersonation.

public class ImpersonatingUserAccessor : IImpersonator, IUserAccessor
parameter description
userContext The underlying user accessor to delegate to when no impersonation is active.
itemsAccessor The accessor that provides the per-request item dictionary used to store the impersonation stack.

Public Members

name description
ImpersonatingUserAccessor(…) Wraps an IUserAccessor and adds support for temporary user impersonation.
User { get; } Gets the current user principal, returning the top of the impersonation stack when impersonation is active.
Impersonate(…) Pushes the specified principal onto the impersonation stack.
UndoImpersonate() Pops the most recent impersonation from the stack.

Remarks

Initializes a new instance of the ImpersonatingUserAccessor class that wraps the specified user accessor and adds impersonation support.

See Also