Grant the passkey permissions to existing roles on upgrade #483

Merged
jcoffey-dev merged 1 commits from fix/478-passkey-upgrade-grants into main 2026-11-19 17:05:59 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev e844ce5525 Grant the passkey permissions to existing roles on upgrade
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m5s
An install from before rc.32 stored its default roles without
sysPasskeyGet/Create/Update/Destroy, and granted_permissions.rs never
added them, so nobody on an upgraded install could list or add a passkey.
An administrator couldn't fix it by hand either: you can't grant a
permission you don't hold.

- Add a User audience that grants to the default user role (not the
  group role), and grant the four passkey permissions to the user,
  tenant administrator and administrator roles, once, as for the
  other fork permissions.
- fork_defaults_reach_upgraded_installs: fails when DefaultPermissions
  gives a fork-added permission (SysAiExplain and later) to the user,
  tenant or administrator role and the upgrade grants don't carry it.
- passkey_tests: strips the permissions from the stored roles, checks a
  new account is refused, runs the start-up defaults, and checks every
  role has them back, a new account can list its passkeys, the group
  role gets none, and a removed one isn't granted twice.

Fixes #478
2026-11-19 09:46:25 -07:00