+13
−3
+116
−26
+339
−1
Loading
Collection restoration previously checked only the destination's update permission, allowing callers to restore denied collections and resources. Authorize the source and destination before loading descendants, then check update access on every item whose state will change. Validate destinations, project boundaries, cycles, root moves, and duplicate titles before saving. Lock affected rows and wrap restoration in a transaction so failures roll back both restored data and queued database tasks. Load descendants by level and cache ACL ancestry in batches. Include deleted collection memberships only when those collections are being restored, keeping legitimate inherited grants and existing permission precedence intact. Restore shared resources once, leave active descendants untouched, and retain the ARK save hooks. Add 15 regression tests covering denied updates, inherited permissions, invalid moves, rollback, save hooks, unchanged active items, and read-query scaling. Validation: all 207 resources, rpc, and annotations tests passed; Ruff and git diff --check passed. A five-run in-memory SQLite benchmark with 21 children and resources reduced total queries from 135 to 93 and median runtime from about 47 ms to 30 ms, including save-hook work.