feat(app-shell): expose object record sharing model (OWD) in Studio Settings tab#2348
Open
os-zhuang wants to merge 1 commit into
Open
feat(app-shell): expose object record sharing model (OWD) in Studio Settings tab#2348os-zhuang wants to merge 1 commit into
os-zhuang wants to merge 1 commit into
Conversation
…dio Settings tab The object designer's Data pillar Settings tab had no control for an object's sharingModel (Org-Wide Default), so record-level isolation was invisible and unconfigurable at design time. An admin who ticked Read/Edit in the permission matrix silently got org-wide read/write, because an unset sharingModel falls through to the runtime's fully-public default. ObjectSettingsPanel now renders a "Record sharing (OWD)" section with a sharingModel selector (private / public_read / public_read_write / controlled_by_parent), a per-option description of the runtime effect, and an amber warning when unset spelling out the fully-public default. Legacy aliases (read → public_read, read_write/full → public_read_write) normalise to their canonical value for display. Fully localized (en-US / zh-CN) and unit-tested. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Problem
In ObjectStack Studio (the objectui
StudioDesignSurface), an admin building objects and permissions had nowhere to set an object's sharing model / OWD (sharingModel: private | public_read | public_read_write | controlled_by_parent). Record-level isolation was therefore invisible and unconfigurable at design time.The consequence, confirmed by dogfooding against the framework showcase app: an admin who created an object without a
sharingModel, then ticked only C/R/U in a permission set (noviewAllRecords), still got org-wide read/write — a user could read and PATCH records owned by others. This is because in the framework runtimebuildReadFilter()only narrows byowner_idwheneffectiveSharingModel(schema) === 'private'; an unsetsharingModelfalls through to a fully-public default. Admins carrying a Salesforce/Dataverse mental model (set OWD=Private first, then grant Read = read-your-own) were silently getting organization-wide access.Grep confirmed
sharingModel/ OWD had 0 UI touchpoints anywhere in objectui.Change
ObjectSettingsPanel(Data pillar → object Settings tab) gains a new "Record sharing (OWD)" section, sitting between Basics and Semantic roles:sharingModel<select>with the four canonical OWD options —private,public_read,public_read_write,controlled_by_parent— plus(not set).read→public_read,read_write/full→public_read_write) are normalised to their canonical value for display.The value is written straight into the object spec draft via the existing
onPatch({ sharingModel }). This is a pure frontend change — thesharingModelspec field already exists (@objectstack/specobject.zod.ts) and the framework runtime already consumes it. Fully localized (en-US / zh-CN).Verification
ObjectSettingsPanel.test.tsx(5 cases): all four canonical options render, the unset "fully public" warning shows, picking a model patchessharingModel, clearing resets it toundefined, and legacy aliasreadnormalises topublic_readfor display. The i18n locale-completeness test still passes (keys added to both locales).turbo run type-checkgreen across all 29 packages.onPatch({ sharingModel: 'private' })and swaps the warning for the owner-isolation description, and selecting Public read/write firesonPatch({ sharingModel: 'public_read_write' }).Full end-to-end owner-isolation (张三 can no longer read/PATCH 李四's records once OWD=Private) is framework-side runtime behavior that already exists and is out of scope for this repo.
🤖 Generated with Claude Code
https://claude.ai/code/session_012oLzaP8n7A3YKFmgaHWC8H
Generated by Claude Code