Class JsonWebTokenPropertyPermissions

Property map for a JWT containing permissions.

Type Param

The type of the arguments needed to test the token.

Type Param

The type of the arguments needed to create the token.

Type Param

The type of the token's data.

Since

0.1.0

Hierarchy

Constructors

Methods

Constructors

Methods

  • Tests if the token contains the required permissions.

    Parameters

    • jwt: {
          perms: string[];
      }

      The JWT to test.

      • perms: string[]

        The permissions the user has.

        Since

        0.1.0

    • param1: {
          permissions_required: string[];
      }

      The arguments needed to test the token.

      • permissions_required: string[]

        The permissions required to access the context.

        Since

        0.1.0

    Returns boolean

    True if the token contains the required permissions, false otherwise.

    Since

    0.1.0

  • Transforms the JWT by adding the permissions.

    Parameters

    • jwt: JsonWebTokenData

      The JWT to transform.

    • args: {
          permissions: string[];
      }

      The arguments needed to transform the JWT.

      • permissions: string[]

        The permissions to add to the JWT.

        Since

        0.1.0

    Returns {
        perms: string[];
    }

    The transformed JWT.

    • perms: string[]

    Since

    0.1.0

Generated using TypeDoc