import { environment } from '../environments/environment'; import { isHostedMount } from './hostedMount'; import { getMountContext, isWpAdminMount } from './mountContext'; // wp-admin acts as the WordPress user (nonce); the staff portal on the practice's own site acts as // the signed-in Akashic user, whom the Akashic API authorizes for this site. An older plugin build // localizes neither, and the practice subdomain has no WordPress at all. export const portalPagesReadable = (): boolean => isWpAdminMount() ? Boolean(environment.wpData?.wpAjaxUrl && environment.wpData?.wpNonce) : getMountContext() === 'staff' && !isHostedMount() && Boolean(environment.wpData?.wpAjaxUrl);