Passkey permissions never granted to existing roles on upgrade: passkeys unusable on pre-rc.32 installs #478

Closed
opened 2026-11-19 16:18:38 +00:00 by jcoffey-dev · 1 comment
Owner

Confirmed (forum t/339 post 3): on an install that predates rc.32, nobody holds the passkey permissions, not even the default admin@ with the standard System Administrator role. Passkeys can't be listed or added anywhere: the webmail section vanishes (inbuxa/inbuxa-webmail#119) and the console's Directory › Accounts card doesn't show. The admin can't fix it by hand either. Adding the permissions to a role, or making a new role with them, fails with "You are not authorized to grant permissions: sysPasskeyDestroy, sysPasskeyUpdate, sysPasskeyCreate, sysPasskeyGet", because you can't grant what you don't hold.

Cause: a new install stores its default roles (User, Group, Tenant Administrator, System Administrator) as explicit enabled_permissions lists from DefaultPermissions (crates/common/src/manager/defaults.rs). Permissions added after that reach older installs only through crates/common/src/manager/granted_permissions.rs, which grants them once to the stored roles. sysPasskeyGet/Create/Update/Destroy (698-701) were never added there. That file also only has Admin, Tenant and Officer audiences, so it can't grant anything to the default User role at all, and passkeys are self-service for every user. Our pre-release click-through ran on a fresh install, where the roles got the permissions directly, so it missed this.

Fix:

  • Add a User audience to granted_permissions.rs that targets the default user role ids, and grant the four sysPasskey* to User, Admin and Tenant (matching DefaultPermissions: user, tenant and superuser). Keep the existing rules: grant once, record it, and respect a role that disables the permission.
  • Test: an install created at rc.31, upgraded to the fix, then admin and a plain user can each list and add a passkey. A fresh install is unchanged.
  • Add a check, test or CI step that fails when DefaultPermissions gives a permission to user, tenant or superuser and granted_permissions.rs doesn't carry it, so the next new permission can't slip through the same way.
  • Release notes for the RC: passkeys now work on upgraded installs, with no action needed.

Still worth covering (lower priority): accounts with their own explicit permission list (Permissions::Replace), custom roles, and tenant ceilings (MT-13) won't get new permissions automatically. Document that.

**Confirmed (forum t/339 post 3):** on an install that predates rc.32, nobody holds the passkey permissions, not even the default `admin@` with the standard System Administrator role. Passkeys can't be listed or added anywhere: the webmail section vanishes (inbuxa/inbuxa-webmail#119) and the console's Directory › Accounts card doesn't show. The admin can't fix it by hand either. Adding the permissions to a role, or making a new role with them, fails with "You are not authorized to grant permissions: sysPasskeyDestroy, sysPasskeyUpdate, sysPasskeyCreate, sysPasskeyGet", because you can't grant what you don't hold. **Cause:** a new install stores its default roles (User, Group, Tenant Administrator, System Administrator) as explicit `enabled_permissions` lists from `DefaultPermissions` (`crates/common/src/manager/defaults.rs`). Permissions added after that reach older installs only through `crates/common/src/manager/granted_permissions.rs`, which grants them once to the stored roles. `sysPasskeyGet/Create/Update/Destroy` (698-701) were never added there. That file also only has Admin, Tenant and Officer audiences, so it can't grant anything to the default **User** role at all, and passkeys are self-service for every user. Our pre-release click-through ran on a fresh install, where the roles got the permissions directly, so it missed this. **Fix:** - Add a User audience to `granted_permissions.rs` that targets the default user role ids, and grant the four `sysPasskey*` to User, Admin and Tenant (matching `DefaultPermissions`: user, tenant and superuser). Keep the existing rules: grant once, record it, and respect a role that disables the permission. - Test: an install created at rc.31, upgraded to the fix, then admin and a plain user can each list and add a passkey. A fresh install is unchanged. - Add a check, test or CI step that fails when `DefaultPermissions` gives a permission to user, tenant or superuser and `granted_permissions.rs` doesn't carry it, so the next new permission can't slip through the same way. - Release notes for the RC: passkeys now work on upgraded installs, with no action needed. Still worth covering (lower priority): accounts with their own explicit permission list (`Permissions::Replace`), custom roles, and tenant ceilings (MT-13) won't get new permissions automatically. Document that.
jcoffey-dev added the bug label 2026-11-19 16:18:38 +00:00
jcoffey-dev self-assigned this 2026-11-19 16:23:28 +00:00
jcoffey-dev added this to the 27.1 milestone 2026-11-19 16:23:28 +00:00
jcoffey-dev added the
priority
p2
label 2026-11-19 16:23:28 +00:00
jcoffey-dev changed title from New sysPasskey* permissions missing from custom roles and explicit permission lists to Passkey permissions never granted to existing roles on upgrade: passkeys unusable on pre-rc.32 installs 2026-11-19 16:29:46 +00:00
jcoffey-dev added
priority
p1
and removed
priority
p2
labels 2026-11-19 16:29:46 +00:00
Author
Owner

Fixed by #483 (merged to main as 82346f32). On start-up, an install from before rc.32 now adds the four passkey permissions once to its built-in user, tenant administrator and administrator roles. A unit test now fails if a later permission is missed the same way. Ships in the next server RC: no action needed after upgrading. Reporter thread: forum t/339.

Fixed by #483 (merged to main as 82346f32). On start-up, an install from before rc.32 now adds the four passkey permissions once to its built-in user, tenant administrator and administrator roles. A unit test now fails if a later permission is missed the same way. Ships in the next server RC: no action needed after upgrading. Reporter thread: forum t/339.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#478