Skip to content

Commit

Permalink
Fix: Fixed check for admin (files-community#13971)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Nov 23, 2023
1 parent 79d31e3 commit dfc7c2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Files.App/Helpers/Environment/ElevationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static bool IsElevationRequired(string filePath)
public static bool IsAppRunAsAdmin()
{
using WindowsIdentity identity = WindowsIdentity.GetCurrent();
return new WindowsPrincipal(identity).IsInRole(WindowsBuiltInRole.Administrator);
return new WindowsPrincipal(identity).IsInRole(new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null));
}
}
}
}

0 comments on commit dfc7c2f

Please sign in to comment.