Class ACL

Hierarchy

  • CreateDestroyStartStop
    • ACL

Constructors

  • Parameters

    • __namedParameters: {
          db: DB;
          logger: Logger;
      }
      • db: DB
      • logger: Logger

    Returns ACL

Properties

[initLock]: RWLockWriter
aclDbPath: readonly (string | Buffer)[] = ...
aclNodesDbPath: readonly (string | Buffer)[] = ...

Nodes stores NodeId -> PermissionId

aclPermsDbPath: readonly (string | Buffer)[] = ...

Perms stores PermissionId -> Ref

aclVaultsDbPath: readonly (string | Buffer)[] = ...

Vaults stores VaultIdString -> Record<NodeId, null> note that the NodeId in each record must be in their own unique gestalt the NodeId in each record may be missing if it had been previously deleted

db: DB
generatePermId: (() => PermissionId)

Type declaration

logger: Logger

Accessors

  • get [destroyed](): boolean
  • Returns boolean

  • get [eventHandled](): ReadonlyWeakSet<Event>
  • Returns ReadonlyWeakSet<Event>

  • get [eventHandlers](): ReadonlyMap<string, Set<EventHandlerInfo>>
  • Returns ReadonlyMap<string, Set<EventHandlerInfo>>

  • get [eventTarget](): EventTarget
  • Returns EventTarget

  • get [handleEventError](): ((evt) => void)
  • Returns ((evt) => void)

      • (evt): void
      • Parameters

        • evt: EventError

        Returns void

  • get [running](): boolean
  • Returns boolean

  • get [statusP](): Promise<Status>
  • Returns Promise<Status>

  • get [status](): Status
  • Returns Status

Methods

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Returns Promise<void>

  • Parameters

    • event: Event

    Returns boolean

  • Gets the permission record for a given node id Any node id is acceptable

    Parameters

    • nodeId: NodeId
    • Optional tran: DBTransaction

    Returns Promise<undefined | Permission>

  • Gets the record of node ids to permission for a given vault id The node ids in the record each represent a unique gestalt If there are no permissions, then an empty record is returned

    Parameters

    • vaultId: VaultId
    • Optional tran: DBTransaction

    Returns Promise<Record<NodeId, Permission>>

  • Parameters

    Returns Promise<void>

  • Parameters

    • vaultId: VaultId
    • vaultIdsJoin: VaultId[]
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

  • Parameters

    • nodeId1: NodeId
    • nodeId2: NodeId
    • Optional tran: DBTransaction

    Returns Promise<boolean>

  • Parameters

    • nodeId: NodeId
    • action: "claim" | "notify" | "scan"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • Sets an array of node ids to a new permission record This is intended for completely new gestalts Or for gestalt splitting.

    Parameters

    Returns Promise<void>

  • Parameters

    • vaultId: VaultId
    • nodeId: NodeId
    • action: "clone" | "pull"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          fresh?: boolean;
      } = {}
      • Optional fresh?: boolean

    Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • nodeId: NodeId
    • action: "claim" | "notify" | "scan"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • nodeId: NodeId
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • vaultId: VaultId
    • nodeId: NodeId
    • action: "clone" | "pull"
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • vaultId: VaultId
    • Optional tran: DBTransaction

    Returns Promise<void>

  • Parameters

    • __namedParameters: {
          db: DB;
          fresh?: boolean;
          logger?: Logger;
      }
      • db: DB
      • Optional fresh?: boolean
      • Optional logger?: Logger

    Returns Promise<ACL>

Generated using TypeDoc