javi-f
12/20/2013 - 10:55 AM

Checks to see if the current user is an Administrator.

Checks to see if the current user is an Administrator.

bool IsAnAdministrator ()
{
    WindowsIdentity  identity = WindowsIdentity.GetCurrent();
    WindowsPrincipal principal = new WindowsPrincipal (identity);
    return principal.IsInRole(WindowsBuiltInRole.Administrator);
}