Documentation
    Preparing search index...

    Function grant

    • Grant a capability to an identity.

      If the identity has no entry, one is created with default caps plus the granted cap. Returns a new AclState — the original is not modified.

      Parameters

      • state: AclState

        Current ACL state

      • identity: Identity

        Napplet identity

      • cap: number

        Capability bit constant to grant (e.g., CAP_RELAY_READ)

      Returns AclState

      New AclState with the capability granted

      const state2 = grant(state, id, CAP_RELAY_READ);
      check(state2, id, CAP_RELAY_READ); // true