Repository navigation
docs(permissions): name declared membershipKeys in the RLS guide's context variables - #26588
Merged
Merged
Conversation
…ntext variables Add the current_user.KEY row to the Context variables table, linked to the reference page's "Where a membership key comes from", and rewrite the closing paragraph to name both sources: a membershipKeys declaration on the roster object first, with one checked example, and a registered membership resolver as the deployment-side extension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaFpnMwgpCgneKe2qS
Contributor
Author
维护者速读
席位核对ACCEPT ·
Generated by Claude Code |
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.
Requested by Warren · project thread
Fixes #26423
维护者速读
current_user.KEY一行(链到参考页「Where a membership key comes from」),并重写表后的收尾段:先讲在名册对象上声明membershipKeys,附一个经类型检查的门户示例,再讲部署侧注册 membership resolver 作为扩展。membershipKeys声明就能解决;参考页与 data 技能早已写明,只缺指南。content/docs/permissions/rls.mdx的 Context variables 一节(新表行与收尾段、示例代码块)。grep -c membershipKeys content/docs/permissions/rls.mdx,预期 3;pnpm check:doc-anchors,预期全部片段链接解析通过。What changes
content/docs/permissions/rls.mdx, section## Context variablesonly:current_user.KEYrow: a set a roster object declares undermembershipKeys, linked to/docs/references/security/rls#where-a-membership-key-comes-from.packages/spec/src/security/rls.zod.tsgives them: a declared key first (userField,valueField, optionalfilteron the roster object), with one checked example (anaccount_memberroster plus a portal permission set readingaccount in current_user.portal_account_ids), then a registered membership resolver as the deployment-side extension. It also carries the runtime facts the spec states: read once per request as a system read in the caller's organization, no read on the roster needed, whoever writes roster rows grants the key, a key both sources claim resolves from neither, and an unsupplied key or one over 1,000 values matches no rows.Shape of truth:
MembershipKeySchema/MembershipKeysSchemaand the module docblock's "Where a membership key comes from" inpackages/spec/src/security/rls.zod.ts, andObjectSchema.membershipKeysinpackages/spec/src/data/object.zod.ts. The example mirrors the oneskills/objectstack-data/rules/security.mdalready type-checks.Why
The guide is the page an author reads first; it sent them to a deployment-side resolver for what one declared key does. On
origin/main1080f07 the guide had 0membershipKeyshits while the reference page carried the key.Tests
Docs-only. The new example carries the
os:checkmarker, socheck:skill-examplestype-checks it against the built@objectstack/specdeclarations.Acceptance notes
current_user.KEYrow with the link;grep -c membershipKeys content/docs/permissions/rls.mdx= 3; the anchor resolves (check:doc-anchorsgreen). The docs build is CI'sBuild Docsjob (not run locally).rls.zod.tsnames a sixth the kernel resolves,accessible_org_ids. Noted only.Verification
All gates run at head
c03a2d59(the only commit; base1080f074).Derived gate set: 45 derived, 45 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 45 commands from the one-path change set; every one ran with exit 0.check:skill-examplesfirst answered exit 3 (PREREQUISITE NOT MET:packages/client-react/distunbuilt); after building@objectstack/client-reactand its dependencies it answered exit 0 with "266 prose examples type-check across 3 surface(s)".check:doc-anchors: "621 internal #fragment link(s) across 430 source file(s) all resolve to a real heading".check:role-word,check:doc-authoring,check:docs-spec-enumerations,check:nul-bytes: exit 0. Reconciliation (--ran): "45 derived famil(ies) accounted for — 45 run, 0 NOT-MEASURED".Not measured locally, left to CI:
Build Docs, the type-check lanes,Plan Test Core shards.Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (no linted source touched; repo-wide lint is CI's)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbaFpnMwgpCgneKe2qS