• Is user product normal organization owner or admin validator

    Parameters

    • config: {
          authSecrets: AuthSecrets;
          authenticate: AuthenticationFunction;
      }

      authenticate config

      • authSecrets: AuthSecrets
      • authenticate: AuthenticationFunction
    • productIdField: TargetField

      which field to get the productId from context

    • productService: ProductDataService

      injected service used to handle the catalog related operations

    • organizationAPI: OrganizationDefaultAdapterAPI

      injected API used to handle the organization related operations

    • 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 is used to check if the user product is normal organization owner or admin by applying the following steps in sequence:

    1. Get the productId from the context

    2. Check if the user is the owner or admin for the products (isUserNormalOrganizationOwnerOrAdminForProductIds)

    Throws

    500 NBError Internal server error

    • ProductId cannot be found in ${productIdField.type}.${productIdField.name}

Generated using TypeDoc