Skip to content

feat(access): let an owner turn an asset's downloads off - #678

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad

@adeelahmad adeelahmad commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: anyone who could see an asset could also save its file, the PDF made of it and its supplementary files.

After: an asset's owners can turn its downloads off, with a Downloads switch in its Access dialog or PUT /api/v1/resources/{rid}/access {"downloads": false}. Everyone else who sees it still plays it, sees its pages and reads its text. Saving its own file, its PDF or its supplementary files answers 403 with the reason, the web app disables those download buttons and says why, and the file tree and IIIF manifests leave the files out. Owners keep saving. It's on for every asset until an owner turns it off, and it isn't copy protection: what plays can still be recorded.

How: access.py gains downloads(), saves() and set_downloads(); /media, /pdf, supplementary downloads, IIIF and the file tree check saves(), while /audio, frames, pages, captions and text don't. Links signed for an owner carry save=1, signed with the rest.

Motivation and Context

Item from the personal feature plan sheet (view without download).

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Turn Downloads off on an asset and open it as an editor: it plays, but Download is disabled with the reason, and GET /media/... answers 403.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/api/test_downloads.py, __tests__/access-model.test.ts).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/access.md, Downloads; docs/api.md).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/asset-downloads-switch.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. downloads on PUT /resources/{rid}/access.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. One switch in the Access dialog.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: a per-asset switch, not a setting.
  • Light: default install still runs on a Raspberry Pi with cloud models.
  • Private and secure: data local and encrypted, passkeys, threat model updated. Access narrows (P-SAVE-OFF), and N-SAVE-CAPTURE notes that playback can still be recorded.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged. On for every asset until an owner turns it off.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). A missing downloads field reads as on.
  • Honest: sources cited; labelled built, in progress or planned. README built list and docs/requirements.md name test_downloads.py.
  • Tests, docs and generated files updated (make openapi).
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented.

Local CI (ci/local-ci.sh on this change over #676): FastAPI embedded, FastAPI server, Next.js, pre-commit and PR title all passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ

downloads: false on an asset (PUT /resources/{rid}/access, or the
Downloads switch in its Access dialog) keeps its files for its owners:
/media, /pdf, supplementary file downloads, IIIF's file and PDF links and
the file tree refuse anyone below owner with 403 and the reason, while
/audio, frames, pages, captions and the text keep working, so it still
plays and reads. Links signed for an owner carry save=1, signed with the
rest. The web app disables its download buttons and says why. On by
default, so nothing changes until an owner turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit 014e2d6 into main Oct 19, 2026
13 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2026 07:11
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.

2 participants