• Is organization owner validator

    Parameters

    • authSecrets: AuthSecrets

      authentication secrets

    • authenticate: AuthenticationFunction
    • isOrganizationOwnerChecker: ((orgId, userId) => Promise<boolean>)

      injected function use to check if the user is the organization owner

        • (orgId, userId): Promise<boolean>
        • Parameters

          • orgId: string
          • userId: string

          Returns Promise<boolean>

    • 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 is the organization owner by applying the following steps in sequence:

    1. Get orgId from context

    2. Check if orgId exists

    3. Check if the user is the organization owner

    Throws

    Error

    • missing orgId in params

    Throws

    403 NBError Forbidden

    • token is not organization owner

Generated using TypeDoc