Repository navigation
feat(access): let an owner turn an asset's downloads off - #678
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pygainsdownloads(),saves()andset_downloads();/media,/pdf, supplementary downloads, IIIF and the file tree checksaves(), while/audio, frames, pages, captions and text don't. Links signed for an owner carrysave=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
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_downloads.py,__tests__/access-model.test.ts).docs/accordingly (docs/access.md, Downloads;docs/api.md).## UnreleasedinCHANGELOG.md. Written aschangelog.d/asset-downloads-switch.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.Done questions (AGENTS.md)
downloadsonPUT /resources/{rid}/access..envedit or manual step.downloadsfield reads as on.docs/requirements.mdnametest_downloads.py.make openapi).Local CI (
ci/local-ci.shon 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