Class FieldVisibilityTrait

Field Visibility Trait is used to hide/replace sensitive fields information based on certain conditions.

Usage:

traits:
# Hide email if user doesn't want it to be displayed.
- type: fieldVisibility
targets:
- field: email
condition: email_visible:true
result: xxxxxxx

Hierarchy

Constructors

Properties

Trait instance configuration.

_global: boolean = false

Whether this is a global (not bound to any specific schema item) trait instance.

_skip_roles: string[] = []
_targets: FieldVisibilityTarget[] = []
_type?: "fieldVisibility"

Trait type.

Methods

  • This method is triggered when a trait callback has been activated

    Type Parameters

    • RT = any

    • Payload = any

    Parameters

    • callbackName: string

      This is the name of the callback function to call.

    • datasourceWrapper: DataSourceWrapper

      References to the Graph Hanlder

    • data: TraitDataObject<RT, Payload, Promise<any>>

      Request data passed along as part of the request.

    Returns Promise<RT>

Generated using TypeDoc