Skip to main content

getProtectedAttributes

@webda/core


Function: getProtectedAttributes()

getProtectedAttributes(model, context?): string[]

Defined in: packages/core/src/services/domainservice.service.ts:160

Attributes a model refuses from client input, declared by its optional static getProtectedAttributes(context?)

The caller context is passed when the input comes from a client (REST, gRPC, MCP, GraphQL, offline sync), so the list can depend on who asks: a model with per-caller rules protects the attribute unless the context proves the caller may write it (an absent context is an unknown caller, not a privileged one).

Parameters​

model​

any

the model class

context?​

IOperationContext

the caller context, undefined when unknown

Returns​

string[]

the attribute names