mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-16 05:30:46 +08:00
Make session visibility preference-driven and keep system-channel ACL separate.
Super/fallback can toggle view-all (default on); admin/user stay own-only while still seeing unowned system sessions. Add restore/prune helpers so empty-shell cleanup is explicit and recoverable.
This commit is contained in:
parent
c26dc68f77
commit
ad0cc98b38
17 changed files with 898 additions and 93 deletions
35
uds-auth/scripts/restore-sessions-from-backup.ps1
Normal file
35
uds-auth/scripts/restore-sessions-from-backup.ps1
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
$ErrorActionPreference = 'Stop'
|
||||
$srcRoot = 'C:\Users\zhout\.dsh\upgrade-backup-20260914-074633\sessions'
|
||||
$dstRoot = 'C:\Users\zhout\.dsh\sessions'
|
||||
|
||||
if (-not (Test-Path $srcRoot)) { throw "backup missing: $srcRoot" }
|
||||
if (-not (Test-Path $dstRoot)) { New-Item -ItemType Directory -Path $dstRoot | Out-Null }
|
||||
|
||||
$copied = 0
|
||||
$skipped = 0
|
||||
|
||||
Get-ChildItem $srcRoot -Directory | ForEach-Object {
|
||||
$proj = $_.Name
|
||||
$srcProj = $_.FullName
|
||||
$dstProj = Join-Path $dstRoot $proj
|
||||
if (-not (Test-Path $dstProj)) {
|
||||
New-Item -ItemType Directory -Path $dstProj | Out-Null
|
||||
}
|
||||
Get-ChildItem $srcProj -Directory | ForEach-Object {
|
||||
$sid = $_.Name
|
||||
$dstSid = Join-Path $dstProj $sid
|
||||
if (Test-Path $dstSid) {
|
||||
$skipped++
|
||||
return
|
||||
}
|
||||
Copy-Item -LiteralPath $_.FullName -Destination $dstSid -Recurse -Force
|
||||
$copied++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output ("copied={0} skipped_existing={1}" -f $copied, $skipped)
|
||||
Write-Output 'LIVE after restore:'
|
||||
Get-ChildItem $dstRoot -Directory | ForEach-Object {
|
||||
$count = @(Get-ChildItem $_.FullName -Directory -ErrorAction SilentlyContinue).Count
|
||||
Write-Output (" {0} => {1}" -f $_.Name, $count)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue