From 2f959ff6acb19ed6f45d723221d8d1f43b11207f Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 29 Jun 2023 20:02:12 +0200 Subject: [PATCH] Allow anyone to edit config --- scripts/Windows/Scripts/Context.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 0e7d1355..35c8c75e 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -26,6 +26,15 @@ class Context { [Microsoft.Win32.RegistryKey] EnsureConfigKey() { if (-not (Test-Path $this.ConfigRoot)) { $null = New-Item $this.ConfigRoot; + $acl = Get-Acl $this.ConfigRoot; + + $acl.AddAccessRule( + [System.Security.AccessControl.RegistryAccessRule]::new( + [System.Security.Principal.SecurityIdentifier]::new([System.Security.Principal.WellKnownSidType]::AuthenticatedUserSid, $null), + [System.Security.AccessControl.RegistryRights]::FullControl, + [System.Security.AccessControl.InheritanceFlags]::ObjectInherit -bor [System.Security.AccessControl.InheritanceFlags]::ContainerInherit, + [System.Security.AccessControl.PropagationFlags]::None, + [System.Security.AccessControl.AccessControlType]::Allow)); } return Get-Item $this.ConfigRoot;