Skip to main content

Function: filterByPermissions()

filterByPermissions(context, permissions): Partial<ITransferContext>

Defined in: src/state/filterByPermissions.ts:20

Permission-gated picker for context fields that are a pure merge into state.context.

Write-side counterpart to getAllContext (the read-side picker in src/context/getAllContext.ts). Same permission pairs drive both directions — reads gated on *.read, writes gated on *.write.

Fields that trigger side effects outside a plain storm merge — action, project, settings.experience, location — are NOT included here. Those live in dedicated branches of createContextChangeHandler because they perform work beyond the storm (replay serialisation, external project lookup, history rewrite).

Parameters

context

Partial<ITransferContext>

permissions

MiniappPermissions

Returns

Partial<ITransferContext>