• Is user match owner info validator

    Parameters

    • authSecrets: AuthSecrets

      authenticate secret

    • authenticate: AuthenticationFunction

      injected authenticate function

    • organizationApi: OrganizationDefaultAdapterAPI
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

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

    Returns Promise<number>

    200 Status OK

    Description

    This validator checks if the user matches the provided owner info by applying the following steps in sequence:

    1. Authenticate the user (authenticate)

    2. If ownerType is user, check if the user id is in the ownerIds

    3. If ownerType is organization, check if the user is the owner or admin of one of the organization ownerIds

    Throws

    403 NBError Forbidden

    • check user subscription validator need token type to be user token
    • user can only create topic for himself

Generated using TypeDoc