Files
PowerToys/src/modules/Hosts/HostsUILib/Helpers/ElevationHelper.cs

21 lines
584 B
C#
Raw Normal View History

2022-10-13 13:05:43 +02:00
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Security.Principal;
namespace HostsUILib.Helpers
2022-10-13 13:05:43 +02:00
{
public class ElevationHelper : IElevationHelper
{
private readonly bool _isElevated;
public bool IsElevated => _isElevated;
public ElevationHelper()
{
_isElevated = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}
}
}