using System;
using System.Security.Principal;

namespace Sasa.QualityTools.DrFx.Tests.Violation.CSharp.Microsoft.Security
{
    public static class Rule2124
    {
        public static void DoSomething()
        {
            WindowsImpersonationContext impersonator = WindowsIdentity.GetCurrent().Impersonate();
            try
            {
                Console.WriteLine(impersonator.ToString());
            }
            finally
            {
                impersonator.Undo();
            }
        }
    }
}
