Guard admin-essential rights + re-seed roles on template edit

Fixkamo-shared-library
Shipped
May 11, 2026 at 8:13 PM UTC
Author
Kamo
Commit
88a8d63

HIGH: **************** now refuses to persist a NUKE or FORCE_NUKE setting on any of the ADMINISTRATOR template's admin-essential rights (CONFIGURE_SYSTEM, MANAGE_MEMBER_SECURITY, MANAGE_MEMBERS, EDIT_MEMBER_ACCESS_LEVEL, ALLOW_PROMOTING_MEMBERS). Without this guard an admin (or a hostile API caller) could lock every child-org owner under a security model out of /settings/account on their own org, with no UI path to recover. Throws **************** which the existing controller-level catch surfaces as 400 with the offending right + setting in the message. MEDIUM: **************** now re-runs **************** for each affected org BEFORE **************** This keeps the org_role_rights table in sync with the template after admins edit a security model — previously only member_rights_applied was refreshed, so the seeded role-rights drifted from the template and confused admins inspecting roles via the UI or direct SQL.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing