Allow anyone to edit config

This commit is contained in:
Manuel Thalmann 2023-06-29 20:02:12 +02:00
parent f9e193524d
commit 1defca4bcd

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;