Follow-up to #1323 (which merged as the prefix surface map): three
learner-blocking gaps remained, and all three sit on URL prefixes that
also host admin-grade operations, so they are matched on the resolved
route template — the same pattern as _LEARNER_KB_READ_ROUTES.
- PUT /api/settings/ui — theme/language save into the caller's own
per-user interface.json; learners currently get 403 changing language.
- PUT/DELETE /api/settings/draft — the settings UI saves through a
per-user draft document; catalog apply stays admin-gated in the
endpoint itself.
- /api/settings/workspace self-management — PUT root (select current
binding), POST /validate, POST /registrations, PATCH
/registrations/{id}. Data migration/export/root-migration/snapshot
routes under the same prefix stay default-denied: they move data
across scopes and carry no internal admin gate.
Rebased onto current main (v1.6.9 layout): _learning_surface_for_path now
lives in deeptutor/api/routers/auth.py; change content unchanged.
- map /api/mastery-paths/* to chat (learner's own per-user progress data)
- map GET/HEAD/OPTIONS /api/knowledge-bases* to reading (browse-only;
mutations still default-deny)
- pass request.method into the surface lookup
- put_guardian_restrictions: when the account has no learning_policy yet,
seed the default learner grant and flip the preset to learner, avoiding
the standard-preset+policy mix that renders the admin shell and 403-storms
- regression tests: tests/multi_user/test_learning_surface_map.py (22 tests)