Fix System missing system actor in prod and prevent deletion #379

Merged
moritz merged 12 commits from fix/system_actor into main 2026-01-27 17:54:49 +01:00
Owner

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

What has been changed?

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

## Description of the implemented changes The changes were: - [x] Bugfixing - [ ] New Feature - [ ] Breaking Change - [ ] Refactoring <!--- Describe the goal of the PR in a few words --> ## What has been changed? <!--- List the things you changed --> ## Definition of Done ### Code Quality - [x] 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 <!--- Add any additional information for the reviewers here -->
moritz self-assigned this 2026-01-27 16:09:58 +01:00
moritz added 5 commits 2026-01-27 16:09:59 +01:00
Creates user system@mila.local with Admin role if missing. Idempotent;
guarantees system actor in production without relying on seeds.
Add destroy validation and explicit destroy action (primary, require_atomic? false).
Validation blocks destroy when email == SystemActor.system_user_email().
Index: filter out SystemActor.system_user_email() in query. Show/Form:
redirect to /users with flash when viewing or editing system actor user.
Index format_error: handle Ash errors without :message field.
Index: system actor not in list, destroy returns Ash.Error.Invalid. Show/Form:
redirect to /users when viewing or editing system actor user.
Add gettext strings for system actor show/edit redirect messages
Some checks failed
continuous-integration/drone/push Build is failing
b5b2317d69
German: Dieser Benutzer kann nicht angezeigt/bearbeitet werden.
moritz added this to the Sprint 11: 08.01-29.01 project 2026-01-27 16:10:00 +01:00
moritz added 6 commits 2026-01-27 17:38:15 +01:00
Use shared ErrorHelpers in UserLive.Index for consistent Ash error formatting.
Case-insensitive email comparison for system-actor detection.
Validation prevents modifying system actor user (required for internal ops).
Use admin_role_id, consistent UUID and timestamps.
Early return / load_user_or_redirect, use system_user? to avoid editing system actor.
fix(seeds): use :update_internal for system user admin-role
Some checks reported errors
continuous-integration/drone/push Build was killed
ebbb4144a5
:update is blocked for system-actor user; use :update_internal in bootstrap.
moritz force-pushed fix/system_actor from ebbb4144a5 to 92ee7fcc63 2026-01-27 17:39:09 +01:00 Compare
moritz added 1 commit 2026-01-27 17:47:14 +01:00
fix(migration): use INSERT..SELECT for system user role_id in CI
All checks were successful
continuous-integration/drone/push Build is passing
462bc21ec3
Avoid nil/empty-string UUID when repo().one lags after role insert.
moritz merged commit d78032d50f into main 2026-01-27 17:54:49 +01:00
moritz deleted branch fix/system_actor 2026-01-27 17:54:50 +01:00
moritz added this to the We have different roles and permissions milestone 2026-02-03 16:43:04 +01:00
Sign in to join this conversation.
No description provided.