Skip to content

feat: Admin account management#104

Merged
ebouchut merged 2 commits into
devfrom
feat/admin-account-management
Jul 14, 2026
Merged

feat: Admin account management#104
ebouchut merged 2 commits into
devfrom
feat/admin-account-management

Conversation

@ebouchut

@ebouchut ebouchut commented Jul 14, 2026

Copy link
Copy Markdown
Owner

This is part 1 of 2 in a stack made with GitButler:

ebouchut added 2 commits July 14, 2026 16:02
The admin area under /admin/users (already gated to ROLE_ADMIN) lists
every account with roles and status, creates INSTRUCTOR accounts, and
archives or reactivates any account.

RegistrationService gains a role-parameterized overload so instructor
creation reuses the exact uniqueness, hashing, and race-safe constraint
mapping of self-registration; the admin sets the initial password and
hands it over out of band, and the instructor can change it through
the existing password-reset flow (recorded in the service Javadoc).
Archiving sets is_active = false, which the login already maps to a
disabled account; an admin cannot archive their own account (409), so
the platform cannot lose its last admin. Account creation, archiving,
and reactivation are audited. The security matrix tightens the admin
gate to 200.
The moderation view at /admin/courses lists every course, whatever its
status or instructor, with its lessons. Archive and restore reuse the
Phase 3 lifecycle methods (same transition guards, same audit trail)
while bypassing only the ownership rule: the admin loads content
directly instead of going through the instructor-owned lookup.

AdminFlowTest drives both admin journeys end to end: the created
instructor account really unlocks the instructor area through its DB
role, an archived account can no longer log in and a reactivated one
can again, self-archiving answers 409, moderation archives and
restores the course of another instructor, and the ADMIN role does
not leak into the instructor area.
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.24691% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.65%. Comparing base (a33c3d8) to head (6bc1726).

Files with missing lines Patch % Lines
...om/ericbouchut/learndev/admin/AdminController.java 69.81% 15 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #104      +/-   ##
============================================
+ Coverage     79.22%   79.65%   +0.42%     
- Complexity      157      177      +20     
============================================
  Files            35       37       +2     
  Lines           669      747      +78     
  Branches         38       41       +3     
============================================
+ Hits            530      595      +65     
- Misses          109      123      +14     
+ Partials         30       29       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ebouchut ebouchut self-assigned this Jul 14, 2026
@ebouchut ebouchut changed the title feat/admin-account-management feat: Admin account management Jul 14, 2026
@ebouchut ebouchut added backend frontend auth Authentication & authorization (login, sessions, password reset, tokens) labels Jul 14, 2026
@ebouchut ebouchut moved this to In Review in learn-dev-project Jul 14, 2026
@ebouchut ebouchut added this to the v0.9 - Code Freeze milestone Jul 14, 2026

@ebouchut ebouchut left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a nit that #106 will fix.

Comment thread src/main/resources/templates/admin/courses.html
@ebouchut
ebouchut merged commit c76b945 into dev Jul 14, 2026
7 checks passed
@ebouchut
ebouchut deleted the feat/admin-account-management branch July 14, 2026 17:10
@github-project-automation github-project-automation Bot moved this from In Review to Done in learn-dev-project Jul 14, 2026
@ebouchut ebouchut added the dwwm label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Authentication & authorization (login, sessions, password reset, tokens) backend dwwm frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant