@refinio/one.models
    Preparing search index...

    This model deals with the user consent.

    The consent can be given and revoked and the object needs to be signed by the user.

    When the consent is given data is shared with a predefined entity. When the consent is revoked this sharing needs to stop.

    The application needs to take care of the previous tasks. Therefore it can:

    • Check the public consentState to see the current consent state
    • Listen and filter on ConsentModel.consentState .onEnterState(state => {if (state == 'Revoked'){ do ...}}) to stop sharing if it is received.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    consentState: StateMachine<
        "Uninitialised"
        | "Given"
        | "Revoked",
        "shutdown" | "giveConsent" | "revokeConsent",
    >
    firstConsentDate: undefined | Date
    onUpdated: OEvent<() => void> = ...
    state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">
    channelId: "consent" = 'consent'

    Methods

    • The init function is only called after ONE is initialized

      It updates the state from storage if no consent changes where queued. Else it writes the queue to storage

      Parameters

      Returns Promise<void>

    • Parameters

      • file: File
      • status: "given" | "revoked"

      Returns Promise<void>

    • Parameters

      • text: string
      • status: "given" | "revoked"

      Returns Promise<void>