Beta
Private
constructorPrivate
_connectedThe DID to use as the author and default target for the underlying permission grant
Private
_grantThe parsed grant object
Private
_messageThe underlying DWN RecordsWrite
message along with encoded data that represent the grant
Private
_permissionsThe PermissionsAPI used to interact with the underlying permission grant
Private
agentThe agent to use for this instantiation of the grant
The conditions under which the grant is valid
The date on which the permission expires
The date the permission was granted
Whether or not the permission grant can be used to impersonate the grantor
(optional) Description of the permission grant
The DID which the permission was granted to
The DID which granted the permission
The grant's ID, which is also the underlying record's ID
The raw RecordsWrite
DWN message with encoded data that was used to instantiate this grant
(optional) The Id of the PermissionRequest if one was used
The permission scope under which the grant is valid
Beta
Signs the current grant as the owner and optionally stores it to the owner's DWN. This is useful when importing a grant that was signed by someone else into your own DWN.
if true, the grant will be stored to the owner's DWN after signing. Defaults to true.
the status of the import request
Beta
Checks if the grant has been revoked.
if true, the check will be made against the remote DWN. Defaults to false.
true if the grant has been revoked, false otherwise.
if there is an error checking the revocation status.
Beta
Revokes the grant and optionally stores the revocation to the owner's DWN.
if true, the revocation will be stored to the owner's DWN. Defaults to true.
the grant revocation object
Beta
Send the current grant to a remote DWN by specifying their DID If no DID is specified, the target is assumed to be the owner (connectedDID).
Optional
target: stringthe optional DID to send the grant to, if none is set it is sent to the connectedDid
the status of the send grant request
Beta
Stores the current grant to the owner's DWN.
if true, the grant will signed by the owner before storing it to the owner's DWN. Defaults to false.
the status of the store request
Static
parseparses the grant given an agent, connectedDid and data encoded records write message
The
PermissionGrant
class encapsulates a permissions protocolgrant
record, providing a more developer-friendly interface for working with Decentralized Web Node (DWN) records.Methods are provided to revoke, check if isRevoked, and manage the grant's lifecycle, including writing to remote DWNs.