Sharing
Sharing protocol schemas
Organization-Wide Defaults (OWD)
The baseline security posture for an object.
Source: packages/spec/src/security/sharing.zod.ts
TypeScript Usage
import { OWDModel, OwnerSharingRule, ShareRecipientType, SharingLevel, SharingRuleType } from '@objectstack/spec/security';
import type { OWDModel, OwnerSharingRule, ShareRecipientType, SharingLevel, SharingRuleType } from '@objectstack/spec/security';
// Validate data
const result = OWDModel.parse(data);OWDModel
Allowed Values
privatepublic_readpublic_read_writecontrolled_by_parent
OwnerSharingRule
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | Unique rule name (snake_case) |
| label | string | optional | Human-readable label |
| description | string | optional | Administrative notes |
| object | string | ✅ | Target Object Name |
| active | boolean | ✅ | |
| accessLevel | Enum<'read' | 'edit' | 'full'> | ✅ | |
| sharedWith | Object | ✅ | The recipient of the shared access |
| type | string | ✅ | |
| ownedBy | Object | ✅ | Source group/role whose records are being shared |
ShareRecipientType
Allowed Values
usergrouprolerole_and_subordinatesguest
SharingLevel
Allowed Values
readeditfull
SharingRuleType
Allowed Values
ownercriteria