Skip to content

[Bug]: admin beforeRoleChange and onAccountStatusChanged hooks skip bulk, account-operations and case paths #466

Closed

Description

@jimhoyd

Runtime revision and environment

main at d939969 (static source review; not executed against a deployment). Node/OS/deployment: not applicable.

Minimal reproduction

Reported by review, not independently reproduced.

The beforeRoleChange veto hook runs only on the /users/roles path (packages/admin/src/admin.ts lines 333-338). Other paths change roles without calling it:

  • /account-operations with assign-roles, including bulk selection — packages/admin/src/admin-account.ts lines 34 and 42 (stageAccountAdministration).
  • Recovery/support case creation with action roles and its approval — admin.ts lines 288 and 300.

Likewise onAccountStatusChanged fires only on /users/status (admin.ts lines 346-347). It does not fire for:

  • /users/bulk lock/unlock (admin.ts lines 224-232);
  • lock/unlock applied through an approved case.

docs/COMPOSING-A-SITE.md:260 and llms-full.txt:3676 describe the veto without qualification, so a project relying on it for policy enforcement is not protected on the other paths.

Relevant output

Expected: every administrative role change passes through beforeRoleChange, and every lock/unlock emits onAccountStatusChanged.

Suggested fix

  • Invoke the hooks at the service boundary (or in one shared admin helper) so every path that applies roles or status runs them, including bulk and case approval (once per affected account).
  • Add a test per path.
  • If some paths are deliberately excluded, document the limits in COMPOSING-A-SITE.md and regenerate llms-full.txt.

Activity

  1. added
    bug
    extension
    important
    on Sep 22, 2026
  2. added 2 commits that reference this issue on Sep 22, 2026
    13e7b38
    5b1cea8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextensionimportant

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions