Skip to main content

CompanyContextParam

Param decorator that retrieves the ActiveCompanyContext resolved by the CompanyPermissionGuard.

Can be used independently or together with @AllowCompanyPermission():

  • Standalone: The guard resolves the company context and returns undefined if none is available (no error thrown). Useful for queries that should gracefully handle the absence of a company context.
  • With @AllowCompanyPermission(): The guard enforces permissions and guarantees the context is non-null. If no context or insufficient permissions, ForbiddenError is thrown before the resolver executes.

Exclusive to Vendure Platform

This page is part of the Vendure Platform documentation. Access requires a valid Vendure Platform license.