Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

847 B
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.

import { IS_LOCAL_DEV } from "@carbon/auth";
import { isInternalEmail } from "@carbon/utils";

/**
 * The internal-staff / local-dev escape hatch for backups. Backups are a
 * Business/Enterprise feature — the authoritative gate is
 * `canManageBackups` (`~/modules/settings/backups.server`), which is
 * `canAccessBackups(email) || companyHasFeature(BACKUPS)`. This helper stays a
 * pure, browser-safe predicate (no plan/DB read) so it can be the escape hatch
 * inside `canManageBackups`.
 */
export function canAccessBackups(email: string | null | undefined): boolean {
  return IS_LOCAL_DEV || isInternalEmail(email);
}