• Does user belong to organization validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction

      authentication function

    • service: OrgUserDataService

      injected service use to handle the organization related operations

    • orgIdField: TargetField

      which field to get the orgId from context

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

      • params is required

    Returns Promise<number>

    200 Status OK

    Description

    This validator will check if the user belongs to the organization by applying the following steps in sequence:

    1. Get orgId from context

    2. Check if orgId exists

    3. Check if the user belongs to the organization

    Throws

    400 NBError Bad Request

    • missing orgId in params

    Throws

    403 NBError Forbidden

    • user does not belong to organization
    • token is not valid user token

Generated using TypeDoc