From a9a89c1f13a4308269dc264a19ff4ee557bb0292 Mon Sep 17 00:00:00 2001 From: HetCreep Date: Sat, 4 Jul 2026 18:57:50 +0700 Subject: [PATCH] fix(store-search): correct deny permission removal in undo path (#684) --- Scripts/Features/StoreSearchSuggestions.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Scripts/Features/StoreSearchSuggestions.ps1 b/Scripts/Features/StoreSearchSuggestions.ps1 index 8054951..aa0fe8c 100644 --- a/Scripts/Features/StoreSearchSuggestions.ps1 +++ b/Scripts/Features/StoreSearchSuggestions.ps1 @@ -158,9 +158,14 @@ function EnableStoreSearchSuggestions { $acl = Get-Acl -Path $StoreAppsDatabase $denyRules = @( $acl.Access | Where-Object { - $_.AccessControlType -eq [System.Security.AccessControl.AccessControlType]::Deny -and - (($_.FileSystemRights -band [System.Security.AccessControl.FileSystemRights]::FullControl) -ne 0) -and - (try { $_.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]) -eq $everyoneSid } catch { $false }) + if ($_.AccessControlType -ne [System.Security.AccessControl.AccessControlType]::Deny) { return $false } + if (($_.FileSystemRights -band [System.Security.AccessControl.FileSystemRights]::FullControl) -eq 0) { return $false } + try { + return ($_.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]) -eq $everyoneSid) + } + catch { + return $false + } } )