Skip to content

✨(backend) add upload-only ("file request") link mode (RFC for #770)#771

Draft
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:feat/upload-only-links
Draft

✨(backend) add upload-only ("file request") link mode (RFC for #770)#771
maartendra wants to merge 1 commit into
suitenumerique:mainfrom
maartendra:feat/upload-only-links

Conversation

@maartendra

Copy link
Copy Markdown

Draft / RFC for #770.

What

Adds an upload-only ("file request") link mode: a link_upload_only flag on Item that, on a link with PUBLIC/AUTHENTICATED reach, grants create-only access. An (anonymous) recipient can add files but cannot list, download, or edit the folder's existing contents.

This is the confidentiality-preserving variant of #706: today the only way to let outsiders upload is Public + Editor, which exposes (and lets them edit) everything already in the folder — a leak for the common "collect documents from many separate people" use case (a therapist collecting client documents, a teacher receiving homework, a posting receiving CVs).

Backend changes

  • Item.link_upload_only boolean + migration 0025.
  • get_abilities: an upload-only link no longer raises the user's role (read / list / download stay off), but children_create is granted even to anonymous users; retrieve stays on so the recipient can see the target folder to upload into.
  • Exposed read-only on ItemSerializer, writable via LinkItemSerializer (the link-configuration endpoint).
  • Tests for the ability behaviour (anonymous upload-only; restricted reach grants nothing).

Deliberately not here yet

  • Frontend: a drop-zone-only recipient view (no file listing) + the share-modal option. Fast-follow once the backend approach is agreed.
  • Main design question 🙏: I kept this a Drive-local flag to avoid touching django-lasuite. If you'd rather model it as a new link role in django-lasuite (consistent across La Suite apps), I'm happy to reshape it — that's the main thing I'd like your steer on.
  • Anti-abuse (per-link size / quota / rate limits) and validation that upload-only requires a non-restricted reach.

Context: we run Drive in production at email.eu and hit this with a real customer, so we're keen to see it through. Feedback very welcome.

RFC / draft for suitenumerique#770. Adds a link_upload_only flag on Item: when set on a
link with PUBLIC or AUTHENTICATED reach, the link grants create-only access.
An (anonymous) recipient can add files but cannot list, download, or edit the
folder's existing contents, unlike the current Public + Editor path which
requires authentication and exposes everything already there.

get_abilities: an upload-only link no longer raises the user's role (so
read/list/download stay off); children_create is granted even anonymously;
retrieve stays on so the recipient can see the target folder to upload into.
Exposed read-only on ItemSerializer and writable via LinkItemSerializer.

Backend only for now; the frontend drop-zone view is a fast-follow. Opening as
a draft to align on the design (this Drive-local flag vs. a role in
django-lasuite) before polishing.
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant