Departed people's files: admin action "Delete unread files" (decided 2026-10-27; mockup first) #654

Closed
opened 2026-09-23 01:02:07 +00:00 by Cordy · 7 comments
Owner

this issue is a deep-dive into scenarios. we solved what happens to the shares, spaces which the departed user is not the owner are out of scope as they simply leave them. as far as i remember, we implemented something for spaces which owner departs, double check this and report back here into a comment what would happen.
what happens to their personal folder when there is no shares? would this be able to be transfered if needed? or what would happen to the storage space? would that get free'd up? is it observable from anywhere from the Admin dashboard?

report findings here.

this issue is a deep-dive into scenarios. we solved what happens to the shares, spaces which the departed user is not the owner are out of scope as they simply leave them. as far as i remember, we implemented something for spaces which owner departs, double check this and report back here into a comment what would happen. what happens to their personal folder when there is no shares? would this be able to be transfered if needed? or what would happen to the storage space? would that get free'd up? is it observable from anywhere from the Admin dashboard? report findings here.
Author
Owner

Cross-reference: the transfer-scope work (shares-only by default per the approved departed-transfer-scope-rev1 mockup) surfaces this same question from the other side — a shares-only transfer deliberately leaves an encrypted remainder in /home/<departed>, summarised on the Departed-owners row ("n files · size, encrypted") with "Transfer remaining files" as its only exit until this issue adds the delete-unread one. When this lands, the estate row gains the second action; the summary line and the estate cache from the scope slice are the plumbing it will reuse. Tackled after the scope slice ships.

Cross-reference: the transfer-scope work (shares-only by default per the approved departed-transfer-scope-rev1 mockup) surfaces this same question from the other side — a shares-only transfer deliberately leaves an encrypted remainder in `/home/<departed>`, summarised on the Departed-owners row ("n files · size, encrypted") with "Transfer remaining files" as its only exit until this issue adds the delete-unread one. When this lands, the estate row gains the second action; the summary line and the estate cache from the scope slice are the plumbing it will reuse. Tackled after the scope slice ships.
Author
Owner

Findings — full departed-owner audit (code state: v0.6.265)

The #569/#597 freeze is enforced at the serve chokepoints (the /shared grants adapter and the public-link surface), not by a sweep — grants stop serving and links freeze when the creator no longer resolves, self-healing if the account returns. Around it: recipients filter (#686, no new grants to departed accounts), admin Active-links tab with the frozen flag (#688), the Departed-owners tab with transfer (all/shares scopes, #689 dialog), revoke-all, and the #650 outage guard (frozen-by-outage ≠ departed; transfer/revoke refuse during an outage). This layer is complete.

2. Spaces whose owner departs — double-checked: nothing space-specific is implemented

Verified by sweep: there is not a single Alive/departed/transfer reference in internal/api/spaces*, internal/spacestore, or internal/spaces. What actually happens today:

  • Members lose nothing. Membership is store-based; owner liveness is never consulted. The space keeps serving exactly as before.
  • No admin lockout. ownerOrAdmin admits any admin, so an admin can always manage members, deactivate, and delete a departed owner's space. (This is the oCIS failure mode we do NOT have — see §6.)
  • But nothing surfaces it. The Spaces inventory shows Owned by <departed> with no marker; the Departed-owners tab lists share-creators and non-empty homes, never owned spaces. An admin has no way to notice a space is ownerless short of cross-checking usernames by hand.
  • Sharp edge: a space that is deactivated and whose owner then departs is readable by nobody (deactivated = owner-read-only, and the owner is gone) until an admin reactivates or deletes it.
  • Owner reassignment doesn't exist for spaces at all — the #719 assign-owner dialog design could be reused here almost verbatim.

3. Personal folder with no shares

  • Visible: yes. ownersDeparted walks /home and lists any non-resolving, non-empty home even with zero share records (the silent-rot guard from the #597 scope slice). The estate summary (files, bytes, shared vs. encrypted remainder; 5-min cached du walk) hangs off that row.
  • Transferable: yes. POST /api/v1/admin/owners/transfer with scope all works with zero grants — /home/<from> moves to /home/<to>/<from> through the move chokepoint (re-encryption to the target's scope, legal holds, versions chain, quota pre-check; repoint is validated before anything moves). Scope shares correctly refuses with "nothing is shared; transfer everything instead". Guards: refuses while the account still resolves, refuses during an IdP outage, target must resolve, destination-exists conflict.

4. Storage — freed? observable?

  • Nothing is freed automatically, and there is no in-app delete. Today's only exits are transfer (bytes are re-attributed to the target's home and quota, not freed) or out-of-band backend deletion. The delete-unread estate action is the missing second exit — exactly what my earlier comment on this issue anticipated; the estate row + cache are the plumbing it would reuse. Deletion through the trash would keep bytes for the retention window (holds refuse early purge; AdminPurge exists and respects both).
  • Observable: the estate row (n files · size, encrypted remainder); the Storage tab's largest home (day-old HomeSizes cache — a departed home can be the largest home, and that is currently the storage tab's only hint); per-user usage feeds the transfer quota pre-check. Seats: a departed holder occupies a seat until the 90-day age-out or a manual release (aging-out chip, audited seat-release).

5. New gaps found while auditing

  1. OCM outbound shares never freeze. The federated serve path (internal/ocm/grant.go) checks only the share's own status — a departed owner's federated shares keep serving to the remote instance indefinitely. The departed sweep, the Departed-owners tab and revoke-all all ignore OCM records (SharesOutFor exists, so listing them is cheap). This is the same class of hole #597 closed for links, one protocol over.
  2. Spaces inventory has no departed-owner marker (§2) — a one-liner conceptually: the same Alive check adminLinks uses for its frozen flag, surfaced as a chip/sub-label on owned rows.
  3. Open verification item: whether a departed user's WebDAV app passwords still authenticate (they verify locally against the app-password store; if the auth path doesn't consult liveness, a departed employee's configured client may retain access). Needs a targeted check of the Basic-auth path before assuming either way — potentially the most security-relevant item here.
  4. Cosmetic: per-user state files (app passwords, favorites, tags, recents) keep stale entries forever after departure; harmless today, part of the #138 state-in-backend inventory.

6. Competitor pitfalls (what we avoid, what we still share)

  • Nextcloud: deleting an account deletes the files, and their shares vanish with it — preservation requires remembering to run Transfer Ownership before deletion (destructive-by-default, order-dependent), and team-folder links invalidate the moment the account is deactivated. Cairn's freeze-not-delete default plus transfer-after-departure is the direct answer to that pitfall.
  • oCIS / OpenCloud lineage: deleting a user leaves the personal space orphaned in storage with no admin surface (ocis#4195), admins cannot manage or delete another user's space (ocis#4194, #4196), and removing a space's last manager leaves it unmanageable by anyone (ocis#4105). We avoid the lockout entirely (admin always has space authority) and #715/#717 just gave orphaned folders an honest label and an exit — but gap 2 above (unmarked departed space owners) is our residual echo of their invisibility problem.

Suggested follow-ups (your call)

  • (a) OCM outbound freeze for departed owners — same rule, same tab.
  • (b) Departed-owner chip on the Spaces inventory (+ optionally reuse #719's assign-owner for spaces).
  • (c) The delete-unread estate action — the second exit this issue originally anticipated.
  • (d) Verify the app-password liveness question (3 in §5) — quick targeted check, file only if it's real.

Sources for §6: Nextcloud blog — what happens to your data when a user account is deleted, Nextcloud community on team-folder links, ocis#4195, ocis#4194, ocis#4196, ocis#4105.

## Findings — full departed-owner audit (code state: v0.6.265) ### 1. Shares and links (recap of what's done) The #569/#597 freeze is enforced at the serve chokepoints (the `/shared` grants adapter and the public-link surface), not by a sweep — grants stop serving and links freeze when the creator no longer resolves, self-healing if the account returns. Around it: recipients filter (#686, no new grants to departed accounts), admin Active-links tab with the frozen flag (#688), the Departed-owners tab with transfer (all/shares scopes, #689 dialog), revoke-all, and the #650 outage guard (frozen-by-outage ≠ departed; transfer/revoke refuse during an outage). This layer is complete. ### 2. Spaces whose owner departs — double-checked: **nothing space-specific is implemented** Verified by sweep: there is not a single `Alive`/departed/transfer reference in `internal/api/spaces*`, `internal/spacestore`, or `internal/spaces`. What actually happens today: - **Members lose nothing.** Membership is store-based; owner liveness is never consulted. The space keeps serving exactly as before. - **No admin lockout.** `ownerOrAdmin` admits any admin, so an admin can always manage members, deactivate, and delete a departed owner's space. (This is the oCIS failure mode we do NOT have — see §6.) - **But nothing surfaces it.** The Spaces inventory shows `Owned by <departed>` with no marker; the Departed-owners tab lists share-creators and non-empty homes, never owned spaces. An admin has no way to notice a space is ownerless short of cross-checking usernames by hand. - **Sharp edge:** a space that is *deactivated* and whose owner then departs is readable by nobody (deactivated = owner-read-only, and the owner is gone) until an admin reactivates or deletes it. - Owner **reassignment** doesn't exist for spaces at all — the #719 assign-owner dialog design could be reused here almost verbatim. ### 3. Personal folder with **no shares** - **Visible: yes.** `ownersDeparted` walks `/home` and lists any non-resolving, non-empty home even with zero share records (the silent-rot guard from the #597 scope slice). The estate summary (files, bytes, shared vs. encrypted remainder; 5-min cached du walk) hangs off that row. - **Transferable: yes.** `POST /api/v1/admin/owners/transfer` with scope `all` works with zero grants — `/home/<from>` moves to `/home/<to>/<from>` through the move chokepoint (re-encryption to the target's scope, legal holds, versions chain, quota pre-check; repoint is validated before anything moves). Scope `shares` correctly refuses with "nothing is shared; transfer everything instead". Guards: refuses while the account still resolves, refuses during an IdP outage, target must resolve, destination-exists conflict. ### 4. Storage — freed? observable? - **Nothing is freed automatically, and there is no in-app delete.** Today's only exits are transfer (bytes are *re-attributed* to the target's home and quota, not freed) or out-of-band backend deletion. The **delete-unread estate action is the missing second exit** — exactly what my earlier comment on this issue anticipated; the estate row + cache are the plumbing it would reuse. Deletion through the trash would keep bytes for the retention window (holds refuse early purge; `AdminPurge` exists and respects both). - **Observable:** the estate row (n files · size, encrypted remainder); the Storage tab's *largest home* (day-old HomeSizes cache — a departed home can be the largest home, and that is currently the storage tab's only hint); per-user usage feeds the transfer quota pre-check. Seats: a departed holder occupies a seat until the 90-day age-out or a manual release (aging-out chip, audited `seat-release`). ### 5. New gaps found while auditing 1. **OCM outbound shares never freeze.** The federated serve path (`internal/ocm/grant.go`) checks only the share's own status — a departed owner's federated shares keep serving to the remote instance indefinitely. The departed sweep, the Departed-owners tab and revoke-all all ignore OCM records (`SharesOutFor` exists, so listing them is cheap). This is the same class of hole #597 closed for links, one protocol over. 2. **Spaces inventory has no departed-owner marker** (§2) — a one-liner conceptually: the same `Alive` check `adminLinks` uses for its frozen flag, surfaced as a chip/sub-label on owned rows. 3. **Open verification item:** whether a departed user's **WebDAV app passwords** still authenticate (they verify locally against the app-password store; if the auth path doesn't consult liveness, a departed employee's configured client may retain access). Needs a targeted check of the Basic-auth path before assuming either way — potentially the most security-relevant item here. 4. Cosmetic: per-user state files (app passwords, favorites, tags, recents) keep stale entries forever after departure; harmless today, part of the #138 state-in-backend inventory. ### 6. Competitor pitfalls (what we avoid, what we still share) - **Nextcloud:** deleting an account **deletes the files, and their shares vanish with it** — preservation requires remembering to run Transfer Ownership *before* deletion (destructive-by-default, order-dependent), and team-folder links invalidate the moment the account is deactivated. Cairn's freeze-not-delete default plus transfer-*after*-departure is the direct answer to that pitfall. - **oCIS / OpenCloud lineage:** deleting a user **leaves the personal space orphaned in storage** with no admin surface (ocis#4195), admins **cannot manage or delete another user's space** (ocis#4194, #4196), and removing a space's last manager leaves it **unmanageable by anyone** (ocis#4105). We avoid the lockout entirely (admin always has space authority) and #715/#717 just gave orphaned *folders* an honest label and an exit — but gap 2 above (unmarked departed space owners) is our residual echo of their invisibility problem. ### Suggested follow-ups (your call) - (a) OCM outbound freeze for departed owners — same rule, same tab. - (b) Departed-owner chip on the Spaces inventory (+ optionally reuse #719's assign-owner for spaces). - (c) The delete-unread estate action — the second exit this issue originally anticipated. - (d) Verify the app-password liveness question (3 in §5) — quick targeted check, file only if it's real. Sources for §6: [Nextcloud blog — what happens to your data when a user account is deleted](https://nextcloud.com/blog/what-happens-to-your-data-when-a-user-account-is-deleted/), [Nextcloud community on team-folder links](https://help.nextcloud.com/t/shared-links-to-files-in-team-folders-transfer-ownership/223806), [ocis#4195](https://github.com/owncloud/ocis/issues/4195), [ocis#4194](https://github.com/owncloud/ocis/issues/4194), [ocis#4196](https://github.com/owncloud/ocis/issues/4196), [ocis#4105](https://github.com/owncloud/ocis/issues/4105).
Author
Owner

Follow-up (b) from the audit above is now shipped: v0.6.266 (#719, PR #723) marks app-owned spaces whose owner verifiably no longer resolves with an "owner departed" sublabel in the Spaces inventory and offers "Assign a new owner…" on those rows — reassignment guarded by the same liveness oracle/outage rules as the Departed-owners tab, audited as space-assign-owner.

Remaining follow-ups from this audit, still open for your call: (a) OCM outbound freeze for departed owners, (c) the delete-unread estate action, (d) the app-password liveness verification.

Follow-up (b) from the audit above is now shipped: v0.6.266 (#719, PR #723) marks app-owned spaces whose owner verifiably no longer resolves with an **"owner departed"** sublabel in the Spaces inventory and offers **"Assign a new owner…"** on those rows — reassignment guarded by the same liveness oracle/outage rules as the Departed-owners tab, audited as `space-assign-owner`. Remaining follow-ups from this audit, still open for your call: (a) OCM outbound freeze for departed owners, (c) the delete-unread estate action, (d) the app-password liveness verification.
Author
Owner

Related decision from #857 (Nikola, 2026-10-08): a disabled owner (the account still exists in the directory) is now its own state, "Paused", separate from departed:

  • public links into their Personal folder stop;
  • public links into Spaces keep serving, flagged "creator disabled" for admin review;
  • internal shares keep working;
  • no transfer or revoke;
  • re-enabling restores everything.

Deleted (departed) owners are unchanged: everything freezes until an admin acts. Open question for this issue and #835: should Space links outlive a departed creator? Research: #857

**Related decision from #857 (Nikola, 2026-10-08):** a **disabled** owner (the account still exists in the directory) is now its own state, "Paused", separate from departed: - public links into their Personal folder stop; - public links into Spaces keep serving, flagged "creator disabled" for admin review; - internal shares keep working; - no transfer or revoke; - re-enabling restores everything. **Deleted (departed)** owners are unchanged: everything freezes until an admin acts. Open question for this issue and #835: should Space links outlive a departed creator? Research: http://192.168.10.245/Cordy/Cairn/issues/857
Author
Owner

Decision (Nikola, 2026-10-27): build "Delete unread files" for a departed person's files, as an admin action next to handing them over. It needs a typed confirm, an audit entry and respect for legal holds, and a whole-page mockup comes first. Size M.

The other points of this issue are covered:

  • (a) is #860.
  • (b) shipped in v0.6.266.
  • (d) is verified in code: departed people's app passwords are refused with local, LDAP and Keycloak accounts. The documented exception is OIDC without a re-check (Entra), where they work until revoked.

This issue now tracks only the new action. I'm renaming it accordingly.

**Decision (Nikola, 2026-10-27):** build "Delete unread files" for a departed person's files, as an admin action next to handing them over. It needs a typed confirm, an audit entry and respect for legal holds, and a whole-page mockup comes first. Size M. The other points of this issue are covered: - (a) is #860. - (b) shipped in v0.6.266. - (d) is verified in code: departed people's app passwords are refused with local, LDAP and Keycloak accounts. The documented exception is OIDC without a re-check (Entra), where they work until revoked. This issue now tracks only the new action. I'm renaming it accordingly.
Cordy changed title from follow up to #569, we covered what happens to shares when the share's owner leaves, what else might be open? to Departed people's files: admin action "Delete unread files" (decided 2026-10-27; mockup first) 2026-10-27 00:39:18 +00:00
Author
Owner

Mockup rev 1 feedback (Nikola, 2026-10-28)

654-delete-unread-mockup.html puts the action on Administration › Sharing › Departed owners. Nikola: that section is about departed owners' share grants; the new action is about their home folders, and an operator would expect it elsewhere. Options to work out:

  • split: share-grant handling stays in Sharing, the home-folder actions move somewhere more fitting; or
  • move the whole Departed owners section elsewhere, renamed Departed users, where every action for a departed user lives (files, shares and links, owned spaces, seat).

Next: a short research on where other admin consoles put this (Google Workspace, Microsoft 365, Nextcloud, OpenCloud, Seafile), then mockup rev 2 with a recommendation. The other recommendations in rev 1 (into the departed person's Deleted files, skip held files, revoke links on deleted files, remove the empty home, per-person busy lock, typed username) still need confirming with rev 2.

## Mockup rev 1 feedback (Nikola, 2026-10-28) `654-delete-unread-mockup.html` puts the action on Administration › Sharing › Departed owners. Nikola: that section is about departed owners' share grants; the new action is about their **home folders**, and an operator would expect it elsewhere. Options to work out: - split: share-grant handling stays in Sharing, the home-folder actions move somewhere more fitting; or - move the whole Departed owners section elsewhere, renamed **Departed users**, where every action for a departed user lives (files, shares and links, owned spaces, seat). Next: a short research on where other admin consoles put this (Google Workspace, Microsoft 365, Nextcloud, OpenCloud, Seafile), then mockup rev 2 with a recommendation. The other recommendations in rev 1 (into the departed person's Deleted files, skip held files, revoke links on deleted files, remove the empty home, per-person busy lock, typed username) still need confirming with rev 2.
Author
Owner

Shipped in v0.6.369 (PR #1040), both dogfoods bumped.

  • Users & access › Departed users (option b): one row per departed person (home folder, shares and links, owned spaces, seat), all actions in one panel (transfer, revoke all, Delete unread files, assign a new owner, release seat); deep link #admin/users/departed/<name>; the old Sharing › Departed owners address redirects; pointers from Shares ("Creator departed" chip), Accounts, Seats and Spaces.
  • Delete unread files: into the person's Deleted files (by = admin), only outside shared items (grants by anyone inside the home, OCM shares out; public links never protect an item and are revoked with it), held files kept, empty home removed; per-person busy lock shared with transfer and revoke-all; runs on server-side (6 h bound) and stops part-way on unreadable holds / account back / IdP outage / lease lost; typed username (NFC, case as stored); refuses with homes off or unverifiable liveness. Audit owner-delete-unread.
  • Also: hold.Store compares in NFC (legacy decomposed holds now protect and can be lifted); owner endpoints refuse non-NFC names.

Live check added to #1005.

Shipped in v0.6.369 (PR #1040), both dogfoods bumped. - **Users & access › Departed users** (option b): one row per departed person (home folder, shares and links, owned spaces, seat), all actions in one panel (transfer, revoke all, Delete unread files, assign a new owner, release seat); deep link `#admin/users/departed/<name>`; the old Sharing › Departed owners address redirects; pointers from Shares ("Creator departed" chip), Accounts, Seats and Spaces. - **Delete unread files:** into the person's Deleted files (by = admin), only outside shared items (grants by anyone inside the home, OCM shares out; public links never protect an item and are revoked with it), held files kept, empty home removed; per-person busy lock shared with transfer and revoke-all; runs on server-side (6 h bound) and stops part-way on unreadable holds / account back / IdP outage / lease lost; typed username (NFC, case as stored); refuses with homes off or unverifiable liveness. Audit `owner-delete-unread`. - Also: `hold.Store` compares in NFC (legacy decomposed holds now protect and can be lifted); owner endpoints refuse non-NFC names. Live check added to #1005.
Cordy closed this issue 2026-10-28 21:47:23 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#654
No description provided.