win32security.ImpersonateSelf

ImpersonateSelf(ImpersonationLevel)

Assigns an impersonation token for current security context to current process

Parameters

ImpersonationLevel : int

A value from SECURITY_IMPERSONATION_LEVEL enum