feat: permissions, a scoped console, and catalog management #7

Merged
dhkatz merged 3 commits from feat/console-permissions into main 2026-11-05 13:13:42 +00:00
Owner

Phase 1 of docs/console.md (builds on #6, whose docs commit it includes; merge #6 first).

API

  • permissions.ts: resource:action permissions, built-in roles as bundles at a scope (hub, catalog, product), can/require, "may give" checks. A missing permission answers 403 with missing: {permission, scope}.
  • Catalog management: settings (incl. rating ceiling, upload policy, mirroring), key rotation, operators, membership (open / approval / invite links, bans), delisting, suspension by moderators, and GET /api/v1/catalog/changes for catalogs.
  • Membership is enforced: getting a product (403 members_only with the catalogs to join), the library list, and outfits relayed to others. Seeing products still needs no membership.
  • Console for everyone who controls a catalog, product or hosted room; /console/audit (tagged entries, scoped by permission, with filters), /console/permissions; /me says whether the console is for them.
  • Migration 0010: role_assignment, catalog_member, catalog_invite, catalog_change, catalog settings, audit tags (backfilled from old entries).

Website

  • Console overview by what you manage; audit log page with filters; catalog list scoped to your teams; a catalog management page (settings, key, team, members, invitations, products, moderation, recent changes).
  • Public catalog pages with join / ask / accept invitation / leave; product pages say "members only" and link the catalogs.

Checked: 43 API tests pass (8 new in catalogs.test.ts); API, web and db type checks; every new page rendered against a local hub for owner, operator, member, outsider and admin; the Eden DELETE-with-query calls tested against the API. Server-action forms weren't clicked through in a browser.

Not in this PR (later phases): catalog deletion requests (with cases), drafts and moderator product edits, notifications, API tokens, two-factor, imports, charts.

🤖 Generated with Claude Code

Phase 1 of `docs/console.md` (builds on #6, whose docs commit it includes; merge #6 first). **API** - `permissions.ts`: `resource:action` permissions, built-in roles as bundles at a scope (hub, catalog, product), `can`/`require`, "may give" checks. A missing permission answers 403 with `missing: {permission, scope}`. - Catalog management: settings (incl. rating ceiling, upload policy, mirroring), key rotation, operators, membership (open / approval / invite links, bans), delisting, suspension by moderators, and `GET /api/v1/catalog/changes` for catalogs. - Membership is enforced: getting a product (403 `members_only` with the catalogs to join), the library list, and outfits relayed to others. Seeing products still needs no membership. - Console for everyone who controls a catalog, product or hosted room; `/console/audit` (tagged entries, scoped by permission, with filters), `/console/permissions`; `/me` says whether the console is for them. - Migration 0010: `role_assignment`, `catalog_member`, `catalog_invite`, `catalog_change`, catalog settings, audit `tags` (backfilled from old entries). **Website** - Console overview by what you manage; audit log page with filters; catalog list scoped to your teams; a catalog management page (settings, key, team, members, invitations, products, moderation, recent changes). - Public catalog pages with join / ask / accept invitation / leave; product pages say "members only" and link the catalogs. **Checked**: 43 API tests pass (8 new in `catalogs.test.ts`); API, web and db type checks; every new page rendered against a local hub for owner, operator, member, outsider and admin; the Eden DELETE-with-query calls tested against the API. Server-action forms weren't clicked through in a browser. Not in this PR (later phases): catalog deletion requests (with cases), drafts and moderator product edits, notifications, API tokens, two-factor, imports, charts. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dhkatz added 2 commits 2026-11-05 07:19:41 +00:00
docs: permissions, console and imported IMVU products
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 58s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped
76497c9b41
Design for managing products, catalogs and importers: permissions as
resource:action strings bundled into roles at a scope, one console scoped
by permission, a tagged audit log, cases, notifications, API tokens and
charts (console.md); catalogs importing IMVU products with their
creators' grants (imports.md); and the contract changes (products.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
feat: permissions, a console for everyone who manages something, and catalog management
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m1s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped
370ae0646a
Phase 1 of docs/console.md: permissions as resource:action strings in role
bundles at a scope; the console for anyone controlling a catalog, product
or room, with a tagged audit log scoped by permission and filters;
catalog settings (rating ceiling, upload policy), key rotation, operators,
membership (approval, invitations, bans) enforced when getting and
wearing products, delisting, suspension, and the catalogs' changes feed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dhkatz added 1 commit 2026-11-05 13:10:56 +00:00
Merge remote-tracking branch 'origin/main' into feat/console-permissions
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m2s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped
8efed4a992
# Conflicts:
#	docs/design.md
dhkatz merged commit 2cbedd26fc into main 2026-11-05 13:13:42 +00:00
dhkatz deleted branch feat/console-permissions 2026-11-05 13:13:42 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: t5de/t5de-hub#7