Repository navigation
feat(access): let a household allow titles above a profile's rating limit - #3562
Conversation
…imit The household's primary profile can allow a limited profile specific movies and series above its content-rating or advisory-age limit, one by one or through a manual personal collection it created (titles added later are allowed too). Other collections, smart ones included, can be copied as individual allowances. A series allowance covers its seasons and episodes. Library restrictions, a custom scope policy's rating override and a stricter Jellyfin MaxOfficialRating still win. Enforcement extends the shared maturity predicate to "within limits OR allowed": the allowed IDs load with the profile row and travel in access.MaturityLimits, so catalog reads, cache keys, cursors and the Jellyfin surface pick them up. Allowances have their own Postgres store, follow title merges, are audited as profile.updated, and are covered by the backup authority check and table classification. Adds nine /api/v2 operations behind a capability, the web title-page "Allow for…" dialog, the profile editor's allowed titles and collections, and the collection "Allow for…" action. Clears the merged #3402 breaking-change approvals and carries the one-line jellycompat test fix from #3552 so the package compiles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (6)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0aa2e2b56c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 0aa2e2b56c
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
- Jellyfin Latest and episode browsing now drop allowances when a client's MaxOfficialRating narrows the ceiling, like item browsing. - Copying a collection copies only titles the household manager may see, for stored and smart collections alike. - A live-allowed collection allows only the movies and series it holds. - A failed search refresh in the profile editor keeps its results and offers a retry. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Allowance writes are authorized before their transaction, so a PIN change in between left revoked proof able to finish a pending write. Each write now locks the acting primary profile and refuses with the household 403 when its PIN revision changed, as profile writes do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae25fd2014
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Native validation tasks also warrant listing: Suggested line:
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
… writes Allowance writes locked the acting profile and then updated the users row, the reverse of account deletion and audited profile writes, so they could deadlock with either. They now take the audit actor locks and the account row first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
A full restore reads account authority from the backup's own schema before it migrates. A backup older than title allowances has neither table, so the read failed and the restore fell back to dropping every carried credential. Such a backup's profiles now read as allowing nothing above their limits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Added the native Multi-profile tasks to the 🤖 Claude Code (claude-opus-5-5) |
…ion and cascade profile_title_allowances.content_id references media_items, so it takes COLLATE "C" and ON UPDATE CASCADE like every other content ID reference, keeping the online re-id working with allowance rows present. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The Validation tasks line omits native-client cases affected by the server-side access change. The multi-profile parent also lists iOS, tvOS, Android, and Android TV tasks; their C1 (kids filtering) and C4 (restricted deep links, search, person pages, and playback) use the server access paths this PR changes. Those task results are currently Suggested line:
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Reading another profile's collection when both profiles have allowances compared every viewer allowance with every owner allowance, up to 10^8 comparisons at the 10,000-title bound. A set of the owner's allowances makes it linear. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 6c2528e43d
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Repeated collection copies can give a profile any number of direct allowances, and listAllowedTitles read and rendered all of them in one response. It now pages by keyset (created_at, content_id), newest first, with the standard limit and cursor, over a matching index; the cursor is bound to the account, both profiles and the viewer policy. A title's per-profile standing checks its one allowance instead of listing every allowance of each profile. The profile editor loads the list a page at a time with "Show more". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…empty state honest An allowance change invalidated the paged list, which refetches every loaded page in turn; it now resets that profile's list to its first page and refreshes the other allowance queries. Cards the acting profile can't see are dropped from each page, so an empty page shows "No titles allowed yet" only when no page follows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 4e74b2506f
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
The read deduplicated live-collection titles before its LIMIT, so heavily overlapping collections made every request of the profile scan their whole membership. It now reads at most 50,000 whole-title entries of the live collections (five times the 10,000-title bound) and deduplicates within them, so overlap up to five times over still yields every distinct title, and past that the rest stay hidden rather than costing every request more. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
The restore authority check compared a profile's resolved allowed titles, which the bounded allowance read caps, so a restored live collection could carry members past the bound that later become effective unchecked. It now also compares every member of the profile's allowed collections, uncapped, as it already compares every direct allowance; the comparisons use a set rather than a search per ID. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 613f0b623f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Account restore's preview and apply filter a profile's items with access.ProfileMaturity, which left out the profile's allowances that Resolve added separately, so restoring into a limited profile skipped the history, progress and other data of titles it is allowed. ProfileMaturity now carries them, and Resolve takes them from it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: #2173
Validation tasks: changes #1180 C2; changes #1181 C1, C4; changes Silo-Server/silo-apple#322 C1, C4; changes Silo-Server/silo-apple#323 C1, C4; changes Silo-Server/silo-android#332 C1, C4; changes Silo-Server/silo-android#333 C1, C4
These cases change only for a profile that has an allowance; a profile without one behaves as before, and an allowance never lifts library restrictions.
A rating limit allows every title at a rating or none of them. A parent who is fine with one particular R movie for a PG profile has to raise the whole profile's limit, or the child can't watch it. Silo has no way to make an exception for a single title or a hand-picked list, so households with children between rating bands end up loosening limits they want to keep.
This lets the household's primary profile allow a limited profile specific movies and series above its rating or advisory-age limit: from the title's page, from the profile editor, or through a collection. The title keeps its rating, other profiles are unaffected, and a limited profile never sees anything it was not allowed.
Approach
catalog.ApplyMaturityLimitsrenders(limits) OR content_id = ANY(allowed), and episode rows key on their series, so a series allowance covers its seasons and episodes. Library restrictions still apply, and so do two stricter limits: a custom scope policy's rating override and a Jellyfin client's narrowerMaxOfficialRating.access.MaturityLimits.AllowedTitleIDs. Catalog reads, shared cache keys, v2 cursors and the Jellyfin surface already copy those limits, so they pick allowances up without per-surface code. A path that builds limits without the list hides allowed titles; it never shows extra ones. Every request a profile makes reads the list, so the read stops at 10,000 titles; past that, the rest stay hidden./api/v2operations behindGET /api/v2/capabilities/title-allowances, for the verified primary profile only. Allowing an episode or season, allowing for a profile with no limit, or allowing a title outside the profile's libraries answers 422. Each write rechecks the acting primary profile's PIN revision in its transaction, like other household writes, and is audited asprofile.updatedon the target profile.Follow-up for
silo-appleandsilo-android: the title action and the profile list. Allowed titles already show and play there with no client change. The user manual needs a section on this too. Those issues will be filed separately.Validation
make lint-changed(0 issues) and the suites of every touched package pass, including their database tests against a fresh migrated PostgreSQL. A new DB contract test follows allowances from the rows to what the catalog admits (inscripts/ci/db-contracts.txt); a handler test covers who may allow what; table rows cover the SQL predicate, shared-collection intersection, the override and the Jellyfin clamp.make test-go(run before the review fixes and the last rebase; every package changed since was re-run): everything passes exceptTestRunStatsWithRealFFmpegandTestCopyRemuxSubtitleRenditionRealFFmpeg, which fail the same way onmainwith this machine's ffmpeg.scripts/ci/db-pins.txt) on a fresh migrated database: passes.make test-db-contractson a fresh database: the same two failures asmainon a fresh database (TestAdminAPIKeyCreationHoldsOwnerRulesAgainstPromotionDB,TestMergeKeepsTheSourceEmbeddingPostgres); none added.make test-web(862 files) pass.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3562/
Surface and build: web app, desktop and phone width, sandbox build of this branch.
Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add household title allowances above a profile's rating limit
profileLimits.looserThanand excludes the allowance tables from single-user restore/import. Media-item merges transfer source allowances to the destination content ID.maturityOverriddenin viewer_resolver.go), and Jellyfin clients that narrow the rating ceiling have allowances cleared (clampMaturityLimitsin content_direct.go). Collection-derived titles count only from live manual collections created by a primary profile, capped atMaxAllowedTitles(10,000).Macroscope summarized dea8150.