Skip to main content

AuditServiceParameters

@webda/core


Class: AuditServiceParameters

Defined in: packages/core/src/services/audit.model.ts:38

Parameters for the AuditService

Extends​

Constructors​

Constructor​

new AuditServiceParameters(): AuditServiceParameters

Returns​

AuditServiceParameters

Inherited from​

ServiceParameters.constructor

Properties​

exposeReadOperations?​

optional exposeReadOperations?: boolean

Defined in: packages/core/src/services/audit.model.ts:69

Register the Audit.Subject, Audit.Actor and Audit.Query operations, which the REST/GraphQL transports then expose. Off by default so adding the service never publishes the audit trail by surprise.

Default​

false

level?​

optional level?: "all" | "write" | "failure"

Defined in: packages/core/src/services/audit.model.ts:53

Audit level filter:

  • "all" — audit everything (default)
  • "write" — everything except read operations (Get, List, Query)
  • "failure" — only failed operations

Default​

"all"

operations?​

optional operations?: string[]

Defined in: packages/core/src/services/audit.model.ts:44

List of operations to include/exclude. Supports wildcards and negation: ["*", "!User.Delete"]

Default​

["*"]

readPermission?​

optional readPermission?: string

Defined in: packages/core/src/services/audit.model.ts:61

WebdaQL query evaluated against the session, required for global (Audit.Query) and other-user (Audit.Actor) reads, and for the history of an object that no longer exists. Unset means nobody.

Example​

"roles CONTAINS 'admin'"

type​

type: string

Defined in: packages/core/src/services/serviceparameters.ts:10

Type of the service

Inherited from​

ServiceParameters.type

Methods​

isIncluded()​

isIncluded(operationId): boolean

Defined in: packages/core/src/services/audit.model.ts:116

Check if an operation is included by this configuration

Parameters​

operationId​

string

the operation identifier

Returns​

boolean

true if the operation is included


load()​

load(params?): this

Defined in: packages/core/src/services/audit.model.ts:82

Load parameters and parse include/exclude lists

Parameters​

params?​

any = {}

the service parameters

Returns​

this

this for chaining

Overrides​

ServiceParameters.load


update()​

update(params?, delta): this

Defined in: packages/core/src/services/serviceparameters.ts:35

Update parameters and call watchers if a parameter was changed

Parameters​

params?​

any = {}

the service parameters

delta​

any

the delta

Returns​

this

this for chaining

Inherited from​

ServiceParameters.update


with()​

with(callback): this

Defined in: packages/core/src/services/serviceparameters.ts:65

Watch for changes on the parameters and call watchers when a parameter is changed

Parameters​

callback​

(params) => void

the callback function

Returns​

this

this for chaining

Inherited from​

ServiceParameters.with