Skip to content

fix(api): let organization admins delete their organization - #344

Merged
anantjain341 merged 1 commit into
CivicDataLab:devfrom
anantjain341:fix/org-delete-admin-check
Dec 1, 2026
Merged

anantjain341 merged 1 commit into
CivicDataLab:devfrom
anantjain341:fix/org-delete-admin-check

Conversation

@anantjain341

Copy link
Copy Markdown
Contributor

Fixes #342

deleteOrganization compared the membership's role (a Role row) with the text "admin". They are never equal, so everyone except superusers was refused, including the organization's own admins. It now compares the role's name.

Who can delete an organization

  • Admins of that organization: now allowed (before: refused).
  • Superusers: allowed, as before.
  • Owners, editors, viewers and admins of other organizations: refused, as before.
mutation { deleteOrganization(organizationId: "12") }

Returns true; a refused caller gets a GraphQL error.

No migration. No frontend caller today.

deleteOrganization compared the membership's role (a Role row) with the
string "admin", which is never equal, so everyone except superusers was
refused, including the organization's own admins. Compare the role name.
@anantjain341
anantjain341 merged commit f419cde into CivicDataLab:dev Dec 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant