Repository navigation
fix(wiki-v2#542,#573,#574): native routes decide what the PDP decides - #64
Merged
Merged
Conversation
… for admin/writer) getUserSpaceRoles maps administer/edit/view strictly: no view -> no role, view without edit -> reader, admin/writer need edit + view. Closes every CASL and collab content path for a view-less space admin, including permanent delete. The collab revalidator decision mirrors it (parity spec). PageRestrictionService.authorize decides space#administer on the PDP in remote mode so the /v1 ACL relay keeps working for such an admin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dcrumbs at hidden ancestors Remote mode 404s (and audits) SpaceController add/remove/change-role: the native routes skip rule M and the platform audit, so a manage_members-only admin could add themselves as a writer. Breadcrumbs keep only the contiguous chain the caller can view (one PDP filter, fail closed to [self]) and null the top kept parent, mirroring /v1 ancestors. Both interceptors live in fork-owned NativeRouteAuthzModule, pinned by a fitness spec. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Seam docmost#121: duplicatePage's insert runs in a transaction where the remote repo checks the exact copied set under the workspace guard lock (the lock g0/g1/g2 take): any own page_access row, or a cross-space copy out of a restricted lineage, refuses with 409 ccc_page_restricted_copy; a dropped root or lock timeout is 503. Race-free against concurrent restrict/move. Also fixes stale 'trash reaps edges' comments (docmost#493). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the custom bigint type
authz-outbox-commit-safety and authz-outbox-retention annotated their reserved connections and
insert helpers as the bare postgres.Sql/ReservedSql (= <{}>) while the pools carry
types.bigint. ts-jest's per-worker language service reports that mismatch depending on which
specs share the worker, so the new pg specs in this PR surfaced it in the authz-compat lane.
tsc --noEmit over every spec is now clean.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
TL;DR
In remote mode, the native engine now decides page access exactly as the PDP does:
space#viewgets no native role.Context
These are three wiki-v2 issues: 542 (space roles without view read content), 573 (duplicate drops restrictions) and 574 (breadcrumbs disclose restricted ancestors). The design record is the wiki-v2 ADR 0025 amendment (docmost#542) and the ADR 0027 amendment (docmost#573, docmost#574). The super PR carries the matching schema change (
space#edit/page#editend in& view), the content smoke, docs, and the gitlink bump.Related issues
What changed
authz/pdp-space-member.repo.tsmaps the role strictly:CASL and collab both read this role. That closes, for a view-less space admin, info (by id or slug), update, trash, restore, move, create, import, sidebar, comments, shares, uploads, collab and permanent delete.
live-access/collab-access.decision.tsmirrors the mapping, pinned by the parity spec.page-restriction.service.tsauthorize(): in remote mode it decides with PDPspace#administer(null → 503), so the/v1ACL relay keeps working for a view-less space admin. Native mode still uses CASL.authz/native-routes/(new,NativeRouteAuthzModule, imported byAuthzModule):SpaceMemberMutationInterceptor404s and auditsSpaceControlleradd/remove/change-role in remote mode. Those native routes skip rule M and the platform audit, so a manage_members-only admin could add themselves as writer.BreadcrumbsRedactionInterceptor:parentPageId, and keeps the contiguous viewable chain.[self].{data,…}; any other shape → 500.authz/page-copy/(new) + seam Feature request: sort by preference docmost/docmost#121 inPageService.duplicatePage:executeTx. Before inserting, the remote repo'sassertCopyKeepsRestrictionschecks the exact copied set under the workspace lock that g0/g1/g2 take.ccc_page_restricted_copywhen a copied page has its ownpage_accessrow, or when a cross-space copy leaves a restricted lineage.Stale comments fixed: "trash reaps edges" (no longer true since [Feature request] Public invite links docmost/docmost#493).
How this was tested
jest src/authz src/service-bridge src/editor-compat src/common/helpers/prosemirror: 144/145 suites, 1900 tests. The one red test isservice-page-import.service.spec.ts, a feat: add new languages to selection docmost/docmost#626 content-parse deadline that fails only under full-lane load on a laptop. It passes 17/17 on its own. It's untouched here; watch it in CI.'src/(service-bridge|authz)/.*\.pg\.spec\.ts$': 29/29 suites, 372 tests. New specs:duplicate-restriction.pg.spec.ts: restricted root, restricted descendant and stale PDP allow → 409 with zero rows inserted.breadcrumbs.pg.spec.ts: the realgetPageBreadCrumbsplus the interceptor.tsc -p tsconfig.build.jsonis clean. The wiki-v2check-upstream-boundary.shpasses.AWS / infra apply
N/A
Checklist
Scope
Tests
Docs & contracts
README/docs// an ADR), or N/A. (In the super PR.)Safety (this is a security-first, deny-by-default platform)
UPSTREAM_MODIFICATIONS.md); proprietary/authz logic stays out-of-process.Housekeeping
Known limitations / follow-ups
/v1, now needs a full admin on the human.collab-app.module.ts,collab:*scripts, not deployed) can't resolve the new module's audit client. This is the same pre-existing gapServiceBridgeModulealready has.🤖 Generated with Claude Code
Implementation plan (canonical, kept current): https://github.com/cccvu/wiki-v2/issues/542#issuecomment-6616313283 . Review comments for this set live on wiki-v2 PR 672.