A model that represents a unique role.

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

Hierarchy (view full)

Implements

Constructors

  • Constructs a new UniqueRoleModel.

    Parameters

    • roleName: string
    • leuteModel: default

      The LeuteModel instance.

    • uniqueRoleRootOfTrustPublicSignKey: HexString

      The public sign key of the unique role.

    • config: Partial<Config> = {}

      The config for the UniqueRoleModel.

    Returns default

Properties

onFound: OEvent<(() => void | Promise<void>)> = ...

Methods

  • ************* Abstracts **************

    Parameters

    • roleName: string

    Returns boolean | Promise<boolean>

  • Gets the personId of the unique role.

    Returns undefined | SHA256IdHash<Person>

    The personId of the unique role or undefined if not found.

  • Gets the personId of the unique role.

    Returns Promise<SHA256IdHash<Person>[]>

    The personId of the unique 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 unique role person.

    Parameters

    • OptionalpersonId: SHA256IdHash<Person>

      The personId to check. Default is the current person.

    Returns Promise<boolean>

    True if the person is the unique role person, false otherwise.

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

    Parameters

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

    Returns Promise<void>

  • Shares the unique role with the given person.

    Parameters

    • personId: SHA256IdHash<Person>

      The personId to share the unique role with.

    Returns Promise<void>