Skip to content

Commit dfc7c2f

Browse files
authored
Fix: Fixed check for admin (#13971)
1 parent 79d31e3 commit dfc7c2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Files.App/Helpers/Environment/ElevationHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static bool IsElevationRequired(string filePath)
2222
public static bool IsAppRunAsAdmin()
2323
{
2424
using WindowsIdentity identity = WindowsIdentity.GetCurrent();
25-
return new WindowsPrincipal(identity).IsInRole(WindowsBuiltInRole.Administrator);
25+
return new WindowsPrincipal(identity).IsInRole(new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null));
2626
}
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)