Class PermissionGrantRevocationBeta

The PermissionGrantRevocation class encapsulates a permissions protocol grant/revocation record, providing a more developer-friendly interface for working with Decentralized Web Node (DWN) records.

Methods are provided to manage the grant revocation's lifecycle, including writing to remote DWNs.

Implements

Constructors

Properties

_connectedDid: string

The DID to use as the author and default target for the underlying revocation

_message: DataEncodedRecordsWriteMessage

The DWN RecordsWrite message, along with encodedData that represents the revocation

_permissions: AgentPermissionsApi

The PermissionsAPI used to interact with the underlying revocation

Accessors

  • get agent(): Web5Agent
  • The agent to use for this instantiation of the grant revocation

    Returns Web5Agent

  • get author(): string
  • The author of the underlying revocation message

    Returns string

  • get rawMessage(): DataEncodedRecordsWriteMessage
  • The raw RecordsWrite DWN message with encoded data that was used to instantiate this grant revocation

    Returns DataEncodedRecordsWriteMessage

Methods

  • Beta

    Send the current grant revocation to a remote DWN by specifying their DID If no DID is specified, the target is assumed to be the owner (connectedDID).

    Parameters

    • Optional target: string

      the optional DID to send the grant revocation to, if none is set it is sent to the connectedDid

    Returns Promise<DwnResponseStatus>

    the status of the send grant revocation request

  • Beta

    Stores the current grant revocation to the owner's DWN.

    Parameters

    • Optional importRevocation: boolean

    Returns Promise<DwnResponseStatus>

    the status of the store request

  • parses the grant revocation given am agent, connectedDid and data encoded records write message

    Parameters

    • __namedParameters: {
          agent: Web5Agent;
          connectedDid: string;
          message: DataEncodedRecordsWriteMessage;
      }
      • agent: Web5Agent
      • connectedDid: string
      • message: DataEncodedRecordsWriteMessage

    Returns Promise<PermissionGrantRevocation>