Repository navigation
Conversation
Tonours
marked this pull request as ready for review
October 27, 2026 20:20
Tonours
marked this pull request as draft
October 27, 2026 20:28
Tonours
marked this pull request as ready for review
October 27, 2026 20:35
Tonours
marked this pull request as draft
October 27, 2026 20:36
Tonours
marked this pull request as ready for review
October 27, 2026 21:09
4 tasks
Scra3
reviewed
Oct 28, 2026
Scra3
left a comment
Member
There was a problem hiding this comment.
Spec (PRD-1820): conforms.
Applies to: the PR description
Claude Opus 5.5 (claude-opus-5-5): Should fix: forest-express-sequelize users keep running without these checks until someone bumps its pinned forest-express, and no ticket asks for it.
Code
forest-express-sequelize/package.json pins "forest-express": "10.9.3" exactly, so it never picks up a new release on its own.
A way out: open a ticket that bumps forest-express in forest-express-sequelize/package.json, like PRD-1813 for mongoose.
Reproduction
- Release forest-express with this PR.
- Install the latest forest-express-sequelize in a project.
- It still resolves forest-express 10.9.3.
Tonours
force-pushed
the
fix/prd-1820-segment-query-permission
branch
from
October 28, 2026 10:54
e180c3f to
4b5f80a
Compare
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.
fixes PRD-1820
Shares one live query segment assertion across the permission middlewares and the has-many related routes, so every route that applies a segment goes through the same permission helper as list and count.
What
src/services/authorization/authorization.tsassertCanExecuteSegmentQuery(user, collectionName, segmentQuery): no-op without a segment, otherwise throwsForbiddenError(403).assertCanBrowseand the new method share one private permission call; the browse error message is unchanged.src/services/exposed/records-getter.jsisExplicitIdSelection/getSelectionSegmentQuery: one rule for whether a bulk selection uses its segment, shared bygetIdsFromRequestand the permission middleware.src/middlewares/permissions.jsexport(),delete()andsmartAction()use the shared segment assertion; new publicsegmentQuery()middleware for routes that need it.src/routes/associations.jssegmentQuery()built for the related collection.jest.config.js,test/helpers/block-network.jsinit()no longer waits on a live API during tests.list()andcount()keep their existing check, unchanged. Charts and smart action form hooks do not read segments and are untouched.Why
reference(embedded documents) fall back to the parent collection name.How to test
yarn install --frozen-lockfileyarn jest test/services/authorization test/middlewares/permissions.unit.test.js test/routes/associations.test.jsyarn testyarn lint;yarn tsc --noEmitDefinition of Done
General
Security