mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Merge pull request #2206 from wabbajack-tools/admin-sid
Improve admin check
This commit is contained in:
commit
df97323bbe
@ -1,9 +1,10 @@
|
||||
### Changelog
|
||||
|
||||
#### Version - 3.0.4.1 - TBD
|
||||
|
||||
* Improved Admin Check
|
||||
* Improved naming of installation fields to clear up some confusion.
|
||||
|
||||
|
||||
#### Version - 3.0.4.0 - 11/12/2022
|
||||
* Upgrade GameFinder to 2.2.1
|
||||
* Update to .NET 7.0 (no user updates required)
|
||||
|
@ -99,8 +99,12 @@ namespace Wabbajack
|
||||
try
|
||||
{
|
||||
var identity = WindowsIdentity.GetCurrent();
|
||||
var owner = identity.Owner;
|
||||
if (owner is not null) return owner.IsWellKnown(WellKnownSidType.BuiltinAdministratorsSid);
|
||||
|
||||
var principle = new WindowsPrincipal(identity);
|
||||
return principle.IsInRole(WindowsBuiltInRole.Administrator);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user