ObjectStackObjectStack

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 { CriteriaSharingRule, OWDModel, OwnerSharingRule, ShareRecipientType, SharingLevel, SharingRule, SharingRuleType } from '@objectstack/spec/security';
import type { CriteriaSharingRule, OWDModel, OwnerSharingRule, ShareRecipientType, SharingLevel, SharingRule, SharingRuleType } from '@objectstack/spec/security';

// Validate data
const result = CriteriaSharingRule.parse(data);

CriteriaSharingRule

Properties

PropertyTypeRequiredDescription
namestringUnique rule name (snake_case)
labelstringoptionalHuman-readable label
descriptionstringoptionalAdministrative notes
objectstringTarget Object Name
activeboolean
accessLevelEnum<'read' | 'edit' | 'full'>
sharedWithObjectThe recipient of the shared access
typestring
conditionstringFormula condition (e.g. "department = 'Sales'")

OWDModel

Allowed Values

  • private
  • public_read
  • public_read_write
  • controlled_by_parent

OwnerSharingRule

Properties

PropertyTypeRequiredDescription
namestringUnique rule name (snake_case)
labelstringoptionalHuman-readable label
descriptionstringoptionalAdministrative notes
objectstringTarget Object Name
activeboolean
accessLevelEnum<'read' | 'edit' | 'full'>
sharedWithObjectThe recipient of the shared access
typestring
ownedByObjectSource group/role whose records are being shared

ShareRecipientType

Allowed Values

  • user
  • group
  • role
  • role_and_subordinates
  • guest

SharingLevel

Allowed Values

  • read
  • edit
  • full

SharingRule

Union Options

This schema accepts one of the following structures:

Option 1

Type: criteria

Properties

PropertyTypeRequiredDescription
namestringUnique rule name (snake_case)
labelstringoptionalHuman-readable label
descriptionstringoptionalAdministrative notes
objectstringTarget Object Name
activeboolean
accessLevelEnum<'read' | 'edit' | 'full'>
sharedWithObjectThe recipient of the shared access
typestring
conditionstringFormula condition (e.g. "department = 'Sales'")

Option 2

Type: owner

Properties

PropertyTypeRequiredDescription
namestringUnique rule name (snake_case)
labelstringoptionalHuman-readable label
descriptionstringoptionalAdministrative notes
objectstringTarget Object Name
activeboolean
accessLevelEnum<'read' | 'edit' | 'full'>
sharedWithObjectThe recipient of the shared access
typestring
ownedByObjectSource group/role whose records are being shared


SharingRuleType

Allowed Values

  • owner
  • criteria

On this page