From 48ef7207e417136535d47c67ce46c783a1dc07be Mon Sep 17 00:00:00 2001 From: breken Date: Wed, 16 Sep 2026 09:59:25 -0700 Subject: [PATCH] fix: limit self-hosted member roles --- src/lib/stores/billing.ts | 2 ++ .../(console)/organization-[organization]/members/edit.svelte | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index f413955175..fd2aac74a6 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -93,6 +93,8 @@ function makeBillingPlan( return typeof billingPlanOrId === 'string' ? billingIdToPlan(billingPlanOrId) : billingPlanOrId; } +export const selfHostedRoles = roles.filter((r) => ['owner', 'developer'].includes(r.value)); + export const projectRoles = roles.filter((r) => r.value !== 'billing'); const projectRoleNames = new Set(projectRoles.map((r) => r.value)); diff --git a/src/routes/(console)/organization-[organization]/members/edit.svelte b/src/routes/(console)/organization-[organization]/members/edit.svelte index 65aeceffae..cb60ae1dc0 100644 --- a/src/routes/(console)/organization-[organization]/members/edit.svelte +++ b/src/routes/(console)/organization-[organization]/members/edit.svelte @@ -14,6 +14,7 @@ import { Icon, Layout, Popover } from '@appwrite.io/pink-svelte'; import { roles, + selfHostedRoles, isProjectSpecificRole, parseProjectRole, buildProjectRole @@ -33,6 +34,7 @@ const supportsProjectRoles = $derived(isCloud && !!$currentPlan?.supportsProjectSpecificRoles); const defaultRole = isSelfHosted ? 'owner' : 'developer'; + const availableRoles = isSelfHosted ? selfHostedRoles : roles; let error = $state(null); let accessType = $state<'all' | 'specific'>('all'); @@ -125,7 +127,7 @@ {/if} {#if accessType === 'all' || !supportsProjectRoles} - +