Skip to content

Commit

Permalink
Update Helpers.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaneri committed Nov 22, 2024
1 parent ad28272 commit b0bd204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Private/Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3807,7 +3807,7 @@ function Test-PodeAdminPrivilege {
# Retrieve the current Windows identity and token
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = [Security.Principal.WindowsPrincipal]::new($identity)

if ($null -eq $principal) {
return $false
}
Expand All @@ -3818,7 +3818,7 @@ function Test-PodeAdminPrivilege {
}

# Check if the token is elevated
if ($identity.IsSystem || $identity.IsAuthenticated -and $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
if ($identity.IsSystem -or $identity.IsAuthenticated -and $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
return $true
}

Expand Down

0 comments on commit b0bd204

Please sign in to comment.