Condition
Home > @gooddata/sdk-model > Condition
Condition type
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Logical condition for evaluating requirement properties.
Supports composable AND/OR logic for determining whether an application should be accessible. Conditions can be nested arbitrarily to express complex boolean expressions.
There are three forms:
**Plain object (implicit AND)** — all specified properties must match their expected values. This is the simplest form and is backwards compatible with the original flat object types. Example: { canInitData: true, canRefreshData: true } // both must be true
**$or condition** — at least one of the nested conditions must be satisfied. Example: { $or: [{ canInitData: true }, { canRefreshData: true }] } // either one suffices
**$and condition** — all nested conditions must be satisfied. Useful when composing with $or at deeper levels to express grouped AND clauses. Example: { $or: [ { $and: [{ canInitData: true }, { canManageProject: true }] }, { canRefreshData: true }, ] }
Signature:
export type Condition<T> = T | IConditionOr<T> | IConditionAnd<T>;
References: IConditionOr, IConditionAnd