Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/stores/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import { Icon, Layout, Popover } from '@appwrite.io/pink-svelte';
import {
roles,
selfHostedRoles,
isProjectSpecificRole,
parseProjectRole,
buildProjectRole
Expand All @@ -33,6 +34,7 @@

const supportsProjectRoles = $derived(isCloud && !!$currentPlan?.supportsProjectSpecificRoles);
const defaultRole = isSelfHosted ? 'owner' : 'developer';
const availableRoles = isSelfHosted ? selfHostedRoles : roles;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Restriction Is Unreachable

The restricted list is used only inside this edit modal, but the modal's only opening action requires organization-role or project-role support, and both flags require cloud mode. Self-hosted users therefore cannot reach this selector, so this change does not deliver the intended self-hosted behavior.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/routes/(console)/organization-[organization]/members/edit.svelte
Line: 37

Comment:
**Restriction Is Unreachable**

The restricted list is used only inside this edit modal, but the modal's only opening action requires organization-role or project-role support, and both flags require cloud mode. Self-hosted users therefore cannot reach this selector, so this change does not deliver the intended self-hosted behavior.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex


let error = $state<string>(null);
let accessType = $state<'all' | 'specific'>('all');
Expand Down Expand Up @@ -125,7 +127,7 @@
{/if}

{#if accessType === 'all' || !supportsProjectRoles}
<InputSelect id="role" label="Role" required options={roles} bind:value={role}>
<InputSelect id="role" label="Role" required options={availableRoles} bind:value={role}>
<Layout.Stack direction="row" gap="none" alignItems="center" slot="info">
<Popover let:toggle>
<Button extraCompact size="s" on:click={toggle}>
Expand Down