# User/group access and approved anonymous publication Implemented first slice, 2026-09-14. This extends, rather than replaces, [locality governance](locality-publication-ownership.md) and [endpoint authorization](authorization-groups.md). No production ACL or public approval is installed automatically. Existing legacy domains remain legacy; configuration of these controls requires `authorization_mode=enforcing`. 2026-09-16 update: [public navigation](public-navigation.md) supersedes the navigation-disabled first-slice restrictions below for children, tree, City Map and locality links. Normal public Pages are navigable and have no download button; a navigation-free view is reserved for share URLs. Approval-policy inheritance and reviewer Inbox are [design/TODO only](publication-approval-inbox.md). ## Authenticated user/group permissions Domain, Quartier, Street and Spot governance dialogs expose a separate access form. `inherit` adds no restriction; `restricted` selects up to 64 local users or groups. Empty selection denies non-administrative content access. | Setting | Newly granted content capabilities | Not newly granted | | --- | --- | --- | | Read only | read | all mutations | | Read/write | read, write, create, upload | delete, rename, link, manage, ownership | This locality selector is deliberately narrower than the existing group-wide `read_write` profile (which also includes rename/link). Existing grants continue to supply their original capabilities, subject to locality restrictions and the temporary namespace fences below. Do not interpret it as an administrator role. - Matching subjects at one locality form a union. Every applicable ancestor restriction is then intersected. A child cannot grant write through a read-only parent or grant access to a subject excluded by a parent. - A Domain administrator can establish a positive grant. A delegated owner can restrict existing/ancestor-granted rights, not invent a new positive grant. - Policy authority is retained: Domain admin = 3, Quartier owner = 2, Spot owner = 1. A subordinate editing a superior-authored policy may remove subjects or downgrade read/write to read, but cannot clear it, add subjects, or promote read to read/write. Such narrowing retains the superior grant/rank. - Active built-in Domain administrators bypass locality content caps for recovery, but still require their underlying capability grants. Ordinary members of an administrative group are not automatically administrators. - Usernames resolve to stable local membership IDs; group names resolve to stable group IDs. Name reuse must not transfer rights. Supplied IDs must agree with resolved names. Group membership, account state and Domain membership are re-evaluated on the next request, not held in a global cache. Readonly principals cannot gain write from a matching group. - The initial username picker resolves password-type username identities; external-only identities need a local username identity before selection. - Object/raw/history access intersects the restrictive caps on all local aliases, even when an Object grant or a different readable alias exists. Listings use a bounded request-scoped snapshot; no positive Object grant reveals otherwise hidden semantic aliases. Exact foreign Object grants also cannot bypass a restricted source-Domain binding; cross-Domain delegation of these new ACLs is not implemented. - Saves recheck active governance authority and epoch/topology in a reserved SQLite write transaction and append local before/after audit records. Content operations already authorized/in flight are not recalled; this is not a distributed linearizable revocation protocol. `GET/PATCH /_/api/v1/city/{domains,zones,spots}/{uuid}/governance/access` uses `epoch`, `topology_version`, `mode`, and entries containing `kind: user|group`, `name`, `permission: read|read_write`, optional stable `id`. Readonly scope, authority rank and grant flags are computed server-side. Missing/stale versions fail; client fields cannot assert administrator status. ### Temporary namespace guard (important operational limitation) Applying a restriction is refused when an in-scope Object already has aliases outside that scope or in another Domain. Resolve these bindings first. SQLite guards apply to CLI/import/direct-store paths as well as HTTP: - Protected Path move, removal and rebinding are refused, as is adding an existing Object inside a restricted scope or aliasing a protected Object out. - New Objects may receive their first Path and revision normally. - City parent/path/state changes and deletions in an ACL-bearing Domain are blocked, including Street–Spot membership changes. Title-only changes remain possible. Automatic/import City mapping may therefore be refused; this is a fail-closed guard, **not** a completed impact-aware reconciliation workflow. - Enforcing mode cannot be disabled while restrictions exist. Do not work around these guards by silently dropping ACLs. A Domain admin can explicitly remove restrictions, but that changes access and needs deliberate review. Replacing this coarse guard with atomic, impact-reviewed mutations is the next priority. ## Anonymous current-content approvals A public Domain ceiling merely permits publication. A local public policy within all ancestor ceilings supplies intent; saving it alone publishes nothing. The dialog's anonymous section offers target enumeration, explicit approval, and revocation. It warns that external caches cannot be recalled. `GET /_/api/v1/city/{domains,zones,spots}/{uuid}/governance/publication` returns an impact token, epoch/topology version, eligible current Path/Object/Revision/SHA-256/language tuples and excluded Paths. Domain itself is not publishable. A candidate is excluded if it has any aliases, is in a reserved namespace, or is under either a user/group restriction or a local authenticated-only ceiling. The actor must be able to read every candidate; governance authority alone cannot enumerate/publish another user's secrets. The metadata-only preview is bounded to 512 Paths, 32 language heads per Object, 2048 entries and three seconds. Exceeding a limit rejects the whole approval; there is no silently truncated approval. The digest includes actor, Domain, scope, versions, entries and exclusions. It is a concurrency commitment, not a bearer credential. An authorized actor must still approve it. `PATCH .../publication` receives `epoch`, `topology_version`, `publication_version`, `enabled`, `impact_token`, `confirm`. Activation reserves the SQL writer, checks current authority, regenerates impact and compares the digest before writing one atomic manifest. A per-scope publication generation advances on both approval and revocation, so pre-revocation consent cannot be replayed to publish again. Revocation does not need impact enumeration or read access to all old contents, so an oversized/now-restricted manifest remains revocable. - Approval binds only current immutable revisions, never future edits or new descendants. All language heads in the preview are included explicitly. - Ordinary Page edits withdraw the affected language entry; Path binding/alias changes withdraw the Object's entries. Restoring an old binding does not silently revive approval. SQLite triggers cover direct store/CLI writes too. - Governance/ACL/owner changes invalidate all manifests in that Domain through their epoch. City changes invalidate manifests conservatively, including title changes in this first slice. Reapproval is explicit. - Different scopes may approve the same Path. Revoking one approval removes only that approval; the UI states that another scope may still publish it. An ancestor authenticated-only policy or a user/group restriction invalidates the Domain's approvals and prevents reapproval of the restricted subtree. - Manifest presence prevents switching the Domain to legacy authorization. - Revocation controls the next request, including conditional/Range requests. It cannot recall in-flight bytes or copies retained by browsers/crawlers. ## Public read surface and exclusions Only GET/HEAD of a known semantic Page URL or `/v/raw/path:{semantic-path}` can use the approved anonymous read path under enforcing mode. It is considered only when no session cookie or Authorization header exists. Invalid/expired credentials do not downgrade to anonymous. Valid authenticated requests keep the authenticated authorization pipeline. Every read checks enabled host-resolved Domain, live binding, current language head, approved digest and current governance/topology versions. Lookup is Path-indexed, metadata-only and limited to two seconds. Raw streaming uses `OpenDocument`/`ServeContent` with Range support and existing identity headers; it does not hydrate large documents or queue preview generation. The dedicated themed Viewer includes no private topbar, bookmarks, user menu, City ancestors or automatic discovery. HTML uses `controlled-v2` plus nonce CSP; code/text is escaped and bounded. Raster images, audio/video and native PDF frames are supported. Raw HTML/SVG/unknown files are sandboxed attachments. Responses remain private/no-store, varying on credentials and language. OGP/X metadata derives only from this approved content and configured Domain identity; ordinary enforcing responses continue suppressing social metadata. **Not part of this slice:** anonymous City/search/browser/children expansion, asset/hash/UUID/revision/history access, derived thumbnails, archive viewers, diagrams, hosted adapters, and dependency manifests. Authored macros remain literal on anonymous HTML pages. Referenced assets are not automatically made public. Restricted user/group scopes are not anonymously publishable: an “everyone can read, selected subjects can write” audience needs a later per-capability audience model (existing write grants remain usable outside a restricted scope). No public production Page is created as a deployment test. ## Follow-up tasks - [ ] Transactional impact-aware move/merge/import/reconciliation, replacing the coarse authenticated namespace freeze without weakening restrictions. - [ ] Atomic per-content-operation authorization snapshots where still checked before mutation; bounded grant evaluation with large policy catalogs. - [ ] Stable local usernames for external-only identities and bounded group name autocomplete; stale/deleted subject diagnostics and orphan cleanup. - [ ] Per-capability audiences (anonymous read plus named writers), preview of effective inherited user/group membership, and privilege-impact confirmation. - [ ] Dependency-aware anonymous children/City/search/media projections and shared assets, retaining exact source/alias authority and revocation. - [ ] Paginated manifest review for larger sites, targeted epoch invalidation, publication expiry/status monitoring and approval co-ownership visibility. - [ ] Domain-sequenced transactional outbox and federated ACL/approval protocol; new local ACL tables are not implicitly exported by current group inheritance. Tests: `TestLocalityUserGroupAccess`, `TestAnonymousApprovedPublication`, `TestCityGovernanceChromium`, `TestAnonymousPublicationChromium`, existing governance concurrency, HTML/browser/auth/read-policy and full regression suites.