• Validate user type validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction
    • userAPI: UserDefaultAdapterAPI

      injected api use to handle the user related operations

    • allowedType: string[]

      allowed user type

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<StatusCodes>

    200 Status OK

    Description

    This validator will check if the user type is allowed to use the operation by applying the following steps in sequence:

    1. Authenticate user

    2. Check if user type is allowed to use the operation

    Throws

    401 NBError Unauthorized

    • authentication failed
    • missing user id in token

    Throws

    403 NBError Forbidden

    • You have no permission to use this operation

Generated using TypeDoc