Package com.ericbouchut.learndev.admin
Class AccountAdminService
java.lang.Object
com.ericbouchut.learndev.admin.AccountAdminService
Account administration: create instructor accounts and archive or
reactivate any account. Archiving means
is_active = false, which
Spring Security already maps to a disabled login (v1 has no destructive
delete); an admin cannot archive their own account (409), so the platform
cannot lock every admin out. The initial instructor password is set by the
admin and handed over out of band; the instructor can change it through
the existing password-reset flow. Every action lands in the audit trail.-
Constructor Summary
ConstructorsConstructorDescriptionAccountAdminService(UserRepository users, RegistrationService registration, AuditService audit) -
Method Summary
Modifier and TypeMethodDescriptionOne account, or 404.allUsers()Every account, for the admin user list.voidArchive an account: the user can no longer log in.createInstructor(RegisterForm form, User actor, String ipAddress) Create anINSTRUCTORaccount (same uniqueness and hashing rules as self-registration, different seeded role).voidreactivate(User target, User actor, String ipAddress) Reactivate an archived account: the user can log in again.voidUnlock an account locked by failed logins and reset its counter.
-
Constructor Details
-
AccountAdminService
public AccountAdminService(UserRepository users, RegistrationService registration, AuditService audit)
-
-
Method Details
-
allUsers
Every account, for the admin user list. -
account
One account, or 404. -
createInstructor
Create anINSTRUCTORaccount (same uniqueness and hashing rules as self-registration, different seeded role). -
archive
Archive an account: the user can no longer log in.- Throws:
org.springframework.web.server.ResponseStatusException- 409 when the admin targets themselves
-
unlock
Unlock an account locked by failed logins and reset its counter. -
reactivate
Reactivate an archived account: the user can log in again.
-