Class AccountAdminService

java.lang.Object
com.ericbouchut.learndev.admin.AccountAdminService

@Service public class AccountAdminService extends Object
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 Details

  • Method Details

    • allUsers

      public List<User> allUsers()
      Every account, for the admin user list.
    • account

      public User account(UUID userId)
      One account, or 404.
    • createInstructor

      @Transactional public User createInstructor(RegisterForm form, User actor, String ipAddress)
      Create an INSTRUCTOR account (same uniqueness and hashing rules as self-registration, different seeded role).
    • archive

      @Transactional public void archive(User target, User actor, String ipAddress)
      Archive an account: the user can no longer log in.
      Throws:
      org.springframework.web.server.ResponseStatusException - 409 when the admin targets themselves
    • unlock

      @Transactional public void unlock(User target, User actor, String ipAddress)
      Unlock an account locked by failed logins and reset its counter.
    • reactivate

      @Transactional public void reactivate(User target, User actor, String ipAddress)
      Reactivate an archived account: the user can log in again.