Treat system account as root on Windows

This commit is contained in:
Archi 2021-11-20 22:19:28 +01:00
parent 0db5d115db
commit 07348a5958
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA

View file

@ -143,7 +143,7 @@ internal static class OS {
if (OperatingSystem.IsWindows()) {
using WindowsIdentity identity = WindowsIdentity.GetCurrent();
return new WindowsPrincipal(identity).IsInRole(WindowsBuiltInRole.Administrator);
return identity.IsSystem || new WindowsPrincipal(identity).IsInRole(WindowsBuiltInRole.Administrator);
}
if (OperatingSystem.IsFreeBSD() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) {