<?php

/*
 * Fail-open fallbacks for SaasSwitcher's global helpers.
 *
 * On the multi-project dev host, SaasSwitcher defines module_entitled() during
 * its provider register() phase (Support/helpers.php) — long before this file
 * is required from ClinicCoreServiceProvider::boot() — so the function_exists
 * guard makes this a no-op there and the real per-business entitlement check
 * stays in charge.
 *
 * On single-project deployments (the standalone Shifa One copy) SaasSwitcher
 * is disabled, the helper never exists, and every DataController menu hook
 * calling module_entitled('X') fatals on each authenticated page. There a
 * single-tenant install is entitled to everything it has installed, so the
 * fallback simply returns true.
 */

if (! function_exists('module_entitled')) {
    function module_entitled($module)
    {
        return true;
    }
}
