Skip to content

The open alternative to Salesforce, designed for AI.

458 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 BillingEnabledGuard implements CanActivate {
  constructor(private readonly twentyConfigService: TwentyConfigService) {}

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