Allow anyone to edit config

This commit is contained in:
Manuel Thalmann 2023-06-29 20:02:12 +02:00
parent c1979a1197
commit 2f959ff6ac

View file

@ -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;