diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts
index d2b42db26..f0c0aec77 100644
--- a/src/lib/stores/billing.ts
+++ b/src/lib/stores/billing.ts
@@ -134,6 +134,19 @@ export function isStarterPlan(
return planHasGroup(billingPlan, BillingPlanGroup.Starter);
}
+export function planSupportsSoc2(
+ billingPlanOrId: string | Models.BillingPlan | null | undefined
+): boolean {
+ const billingPlan = makeBillingPlan(billingPlanOrId);
+ if (!billingPlan) {
+ return false;
+ }
+
+ // no SOC-2 entitlement exists on the plan model, so infer it: Scale is the
+ // lowest group that advertises SOC-2, and contract plans sit above it.
+ return planHasGroup(billingPlan, BillingPlanGroup.Scale) || billingPlan.selfService === false;
+}
+
export function canUpgrade(
billingPlanOrId: string | Models.BillingPlan | null | undefined
): boolean {
diff --git a/src/routes/(console)/organization-[organization]/settings/Soc2.svelte b/src/routes/(console)/organization-[organization]/settings/Soc2.svelte
index 167a80261..8a63463e4 100644
--- a/src/routes/(console)/organization-[organization]/settings/Soc2.svelte
+++ b/src/routes/(console)/organization-[organization]/settings/Soc2.svelte
@@ -2,11 +2,22 @@
import { Box, CardGrid } from '$lib/components';
import { Button } from '$lib/elements/forms';
import Soc2Modal from './Soc2Modal.svelte';
- import type { Models } from '@appwrite.io/console';
+ import { getBasePlanFromGroup, getChangePlanUrl, planSupportsSoc2 } from '$lib/stores/billing';
+ import { currentPlan, organization } from '$lib/stores/organization';
+ import { BillingPlanGroup, type Models } from '@appwrite.io/console';
- let show = false;
- export let locale: Models.Locale;
- export let countryList: Models.CountryList;
+ let {
+ locale,
+ countryList
+ }: {
+ locale: Models.Locale;
+ countryList: Models.CountryList;
+ } = $props();
+
+ let show = $state(false);
+
+ const supportsSoc2 = $derived(planSupportsSoc2($currentPlan));
+ const upgradePlanName = $derived(getBasePlanFromGroup(BillingPlanGroup.Scale)?.name);
@@ -22,16 +33,34 @@
compliance with trust service criteria such as security, availability, processing
integrity, confidentiality, and privacy.
-
+ {#if supportsSoc2}
+
+ {:else}
+
+ SOC-2 is not available on your current plan.{upgradePlanName
+ ? ` Upgrade to ${upgradePlanName} to request a SOC-2 report for your organization.`
+ : ''}
+