Skip to content

The open alternative to Salesforce, designed for AI.

460 B
Raw Blame
import {
  type CanActivate,
  type ExecutionContext,
  Injectable,
} from '@nestjs/common';

import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';

@Injectable()
export class BillingDisabledGuard implements CanActivate {
  constructor(private readonly twentyConfigService: TwentyConfigService) {}

  canActivate(_context: ExecutionContext): boolean {
    return !this.twentyConfigService.isBillingEnabled();
  }
}