Keep roles other than Admin on single sign-on closes #646 #649

Merged
simon merged 4 commits from issue/mitgliederverwaltung-646 into main 2026-11-09 18:20:55 +01:00
Owner

closes #646

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Single sign-on: a role assigned in Mila, such as a board role, survives every sign-in; the admin group grants and removes only the Admin role.

What has been changed?

  • Keep roles other than Admin on sign-in and log what the role sync leaves unchanged
  • Say under the admin group name that single sign-on manages only the Admin role
  • Describe which roles the OIDC role sync changes
  • Record that single sign-on keeps roles other than Admin under Unreleased

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • Option A of the issue only. Mapping groups to roles (option C), a hint at the role select in the user form, and which role counts as "Admin" (today the role named "Admin") are left for a follow-up issue.
  • Sync rule (Mv.OidcRoleSync.decide/2): in the admin group → Admin; an Admin not in it → Mitglied, also when the claim is an empty list; any other role stays. A claim missing from both the ID token user info and the access token, or one that is not a list of strings, changes nothing and logs a warning.
  • Also fixes a defect on main: demoting the last Admin was refused by EnsureAdminRemains inside the sign-in transaction and rolled the whole sign-in back, so that admin could not sign in at all. The role update now runs with rollback_on_error?: false; the refusal is logged and the sign-in succeeds.
  • Larger commit: 77b8564d (sync rewrite plus its tests, incl. a serial oidc_role_sync_logging_test.exs that captures logs).
  • The settings help shows in both modes; EnvConfig.env_group/env_input gain an optional help attribute for it.
closes #646 ## Description of the implemented changes The changes were: - [x] Bugfixing - [x] New Feature - [ ] Breaking Change - [ ] Refactoring Single sign-on: a role assigned in Mila, such as a board role, survives every sign-in; the admin group grants and removes only the Admin role. ## What has been changed? - Keep roles other than Admin on sign-in and log what the role sync leaves unchanged - Say under the admin group name that single sign-on manages only the Admin role - Describe which roles the OIDC role sync changes - Record that single sign-on keeps roles other than Admin under Unreleased ## Definition of Done ### Code Quality - [ ] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes - Option A of the issue only. Mapping groups to roles (option C), a hint at the role select in the user form, and which role counts as "Admin" (today the role named "Admin") are left for a follow-up issue. - Sync rule (`Mv.OidcRoleSync.decide/2`): in the admin group → Admin; an Admin not in it → Mitglied, also when the claim is an empty list; any other role stays. A claim missing from both the ID token user info and the access token, or one that is not a list of strings, changes nothing and logs a warning. - Also fixes a defect on main: demoting the last Admin was refused by `EnsureAdminRemains` inside the sign-in transaction and rolled the whole sign-in back, so that admin could not sign in at all. The role update now runs with `rollback_on_error?: false`; the refusal is logged and the sign-in succeeds. - Larger commit: 77b8564d (sync rewrite plus its tests, incl. a serial `oidc_role_sync_logging_test.exs` that captures logs). - The settings help shows in both modes; `EnvConfig.env_group`/`env_input` gain an optional `help` attribute for it.
A refused demotion (last admin) used to roll back the whole sign-in
transaction, so the last admin could not sign in at all; the role update
now runs with rollback_on_error? false.
docs(changelog): record that single sign-on keeps roles other than Admin under Unreleased
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
56b3d68148
simon merged commit c882985e2c into main 2026-11-09 18:20:55 +01:00
simon deleted branch issue/mitgliederverwaltung-646 2026-11-09 18:20:55 +01:00
Sign in to join this conversation.
No description provided.