Log in
Model

User

Magento\User\Model\ResourceModel\User

What it does

This resource model manages database operations for admin users in Magento 2, including authentication, role assignments, password tracking, and account locking mechanisms.

Developers use this class when working with admin user data persistence, managing user-role relationships, implementing password policies, or handling login attempts and account security features.

It provides methods for CRUD operations on admin users and their associated authorization roles.

Public Methods

  • recordLogin()
  • loadByUsername()
  • hasAssigned2Role()
  • _clearUserRoles()
  • delete()
  • getRoles()
  • deleteFromRole()
  • roleUserExists()
  • userExists()
  • isUserUnique()
  • saveExtra()
  • countAll()
  • getValidationRulesBeforeSave()
  • updateRoleUsersAcl()
  • unlock()
  • lock()
  • updateFailure()
  • getOldPasswords()
  • trackPassword()
  • getLatestPassword()