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

    A model that represents a sign key role.

    Note: Depends on the reverse maps of the LeuteModel to be able to find the someone from the personId.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a new SignKeyRoleModel.

      Parameters

      • leuteModel: default

        The LeuteModel instance.

      • roleSignKeys: HexString[]

        The public sign keys of the role.

      • config: SignKeyRoleConfig = {}

        The config for the SignKeyRoleModel.

      Returns default

    Properties

    onFound: OEvent<() => void | Promise<void>> = ...
    onInitialised: OEvent<() => void | Promise<void>> = ...
    state: StateMachine<"Uninitialised" | "Initialised", "shutdown" | "init">
    roleName: string

    Methods

    • Gets the personIds of the sign key role.

      Returns Promise<SHA256IdHash<Person>[]>

      The personIds of the sign key role in an one indexed array or an empty array if not found.

    • Checks if the data is affirmed by the role person ids.

      Parameters

      • data: SHA256Hash | SHA256IdHash

        The data to check.

      • OptionalbyPersonId: SHA256IdHash<Person>

        The personId that should be trusting the data.

      Returns Promise<boolean>

      True if the data is affirmed, false otherwise.

    • Checks if the data is signed by the role person ids.

      Parameters

      • data: SHA256Hash

        The data to check.

      • OptionalbyPersonId: SHA256IdHash<Person>

        The personId that should be signing the data.

      Returns Promise<boolean>

      True if the data is signed, false otherwise.

    • Checks if the person is the sign key role person.

      Parameters

      • OptionalpersonId: SHA256IdHash<Person>

        The personId to check. Default is the current person.

      Returns Promise<boolean>

      True if the person is the sign key role person, false otherwise.

    • ************* Not allowed **************

      Parameters

      • personId: SHA256IdHash<Person>
      • OptionalcreatorId: SHA256IdHash<Person>

      Returns Promise<void>

    • Parameters

      • rolePersonId: SHA256IdHash<Person>
      • shareWithPersonIds: SHA256IdHash<Person>[]

      Returns Promise<void>

    • Shares the sign key role with the given person.

      Parameters

      • withPersonIds: SHA256IdHash<Person>[]

        The personIds to share the sign key role with.

      • options: { forcePropagate?: boolean; rolePersonId?: SHA256IdHash<Person> } = {}

      Returns Promise<void>