A write grantee can delete the owner's whole shared folder (and cannot restore it) #973

Closed
opened 2026-10-19 21:02:20 +00:00 by Cordy · 2 comments
Owner

Found in the batch 4 research (research-b4.md §7.3). Verified on posix and s3.

What happens: bob holds a write grant on anna's /home/anna/proj. When he deletes /shared/anna/proj, the owner's folder is gone. The entry sits in anna's trash with by=anna, which #915 will correct, and bob gets not-found when he tries to restore it. resolved.isRoot() is false for grant paths by design (scope/shared.go:267-278).

How others handle it: in Nextcloud, a recipient who deletes a share root leaves the share; the owner's data is not deleted (forum 79435).

Decision needed (research first, then asked):

  • refuse the delete;
  • turn it into "leave this share";
  • keep it, with a strong confirm that names the owner.
Found in the batch 4 research (`research-b4.md` §7.3). Verified on posix and s3. **What happens:** bob holds a write grant on anna's `/home/anna/proj`. When he deletes `/shared/anna/proj`, the owner's folder is gone. The entry sits in anna's trash with `by=anna`, which #915 will correct, and bob gets `not-found` when he tries to restore it. `resolved.isRoot()` is false for grant paths by design (`scope/shared.go:267-278`). **How others handle it:** in Nextcloud, a recipient who deletes a share root leaves the share; the owner's data is not deleted (forum 79435). **Decision needed (research first, then asked):** - refuse the delete; - turn it into "leave this share"; - keep it, with a strong confirm that names the owner.
Author
Owner

Research and decision (2026-10-28): see the C2 decision sheet.

Background: Google and Dropbox never let a recipient delete the owner's shared folder; their "delete" means leave. Nextcloud's "Leave this share" undo has been broken in production (forum 243890 in 2026, 79435 in 2020). Since #915, the deleted folder is recorded with the person who deleted it.

Decision (Nikola): refuse now, add "Leave share" later.

  • Now: deleting the top folder of a share is refused for the person it is shared with, on every surface (REST, WebDAV, TUS), with 403 and a code. The web menu hides Delete there.
  • Later: "Leave share", with a list of left shares to rejoin from, as its own feature. It needs a mockup first.
**Research and decision (2026-10-28):** see the C2 decision sheet. **Background:** Google and Dropbox never let a recipient delete the owner's shared folder; their "delete" means leave. Nextcloud's "Leave this share" undo has been broken in production (forum 243890 in 2026, 79435 in 2020). Since #915, the deleted folder is recorded with the person who deleted it. **Decision (Nikola):** refuse now, add "Leave share" later. - **Now:** deleting the top folder of a share is refused for the person it is shared with, on every surface (REST, WebDAV, TUS), with 403 and a code. The web menu hides Delete there. - **Later:** "Leave share", with a list of left shares to rejoin from, as its own feature. It needs a mockup first.
Author
Owner

Shipped in v0.6.366 (PR #1032), both dogfoods bumped.

  • A grantee can no longer delete, move away, or COPY/MOVE-with-overwrite onto the top folder or the shared file of a share (decision 2026-10-28: files too). REST, WebDAV and TUS answer 403 code share-root; the REST body carries owner and kind. A WebDAV COPY/MOVE with Overwrite onto a root now answers 403 instead of 404.
  • Writing a shared file's content (PUT, TUS, office) still works.
  • Web: Delete, Move and Rename are hidden on share roots; the selection bar and drag-and-drop skip them. Texts: "This folder/file belongs to {owner}. Ask {owner} to stop sharing it." (EN/DE/FR/IT).
  • A share-root check that can't read the backend now refuses instead of letting the delete through.

Still open from the decision: "Leave share" (remove a share from your own view) needs a mockup; it goes to a new issue. Live check moved to #1005.

Shipped in v0.6.366 (PR #1032), both dogfoods bumped. - A grantee can no longer delete, move away, or COPY/MOVE-with-overwrite onto the top folder **or the shared file** of a share (decision 2026-10-28: files too). REST, WebDAV and TUS answer 403 code `share-root`; the REST body carries `owner` and `kind`. A WebDAV COPY/MOVE with Overwrite onto a root now answers 403 instead of 404. - Writing a shared file's content (PUT, TUS, office) still works. - Web: Delete, Move and Rename are hidden on share roots; the selection bar and drag-and-drop skip them. Texts: "This folder/file belongs to {owner}. Ask {owner} to stop sharing it." (EN/DE/FR/IT). - A share-root check that can't read the backend now refuses instead of letting the delete through. Still open from the decision: **"Leave share"** (remove a share from your own view) needs a mockup; it goes to a new issue. Live check moved to #1005.
Cordy closed this issue 2026-10-28 01:59:55 +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#973
No description provided.