feat: permanent console user deletion for self-hosted (#11393)#3117
feat: permanent console user deletion for self-hosted (#11393)#3117schneidermr wants to merge 3 commits into
Conversation
Fixes appwrite/appwrite#11393 Self-hosted organization owners can permanently delete platform (console) accounts, not only remove org memberships. Adds a Platform users page and an optional permanent-delete path when removing members.
Greptile SummaryThis PR adds GUI support for permanent console-account deletion on self-hosted Appwrite instances — filling the gap where removed members could still sign in as "shadow accounts." The feature is correctly gated behind
Confidence Score: 5/5Safe to merge; all permanent-delete paths are correctly gated to self-hosted owners and the single-call deletion strategy avoids partial-failure shadow accounts The logic across all three delete surfaces (member checkbox, platform-users page, route guard) is consistent and fail-closed. The helper functions have complete unit-test coverage. No data-loss or auth-bypass paths were found in the new code. The trade-offs in the SDK client (per-call allocation, impersonation registration) are acknowledged by the author and match the existing No files require special attention beyond what has already been discussed in prior review threads. Important Files Changed
Reviews (3): Last reviewed commit: "fix(sdk): use fresh client for org-scope..." | Re-trigger Greptile |
- Gate platform-users load on owner role (clean redirect) - Migrate new/touched components to Svelte 5 runes - Narrow org-scoped Users helper with reused Client
Avoid shared-client header staleness with impersonation by building a new Client per call (matching organization()), while still returning only a narrow Users instance.
Summary
Fixes appwrite/appwrite#11393.
Self-hosted administrators could only remove members from an organization. The console account remained and could sign in and create new organizations ("shadow accounts").
This PR adds GUI support for permanent platform account deletion on self-hosted instances:
sdk.forConsoleInOrganization(orgId)— setsX-Appwrite-Organizationso the Users API receivesusers.writeon the console projectCloud is unchanged (no permanent-delete UI, no Platform users tab).
Why this works
The backend already supports permanent deletion:
A prior attempt (appwrite/appwrite#11587) only added a legacy SDK stub and closed without GUI changes. The console already has
@appwrite.io/consoleUsers service — the missing piece was UI + organization-scoped client.Related backend PR
Companion safeguards: appwrite/appwrite#12850 — block self-delete via Users API and deletion of the last console user.
Test plan
consoleUsers.test.ts— 8 tests)DELETE /v1/users/{id}with org context → 204, login fails afterwardusers.writebun run check— 0 errors on changed filesSecurity notes
isSelfHosted)