@Transactional
  public synchronized void removeUser(UserEntity userEntity) throws AmbariException {
    if (userEntity != null) {
      if (!isUserCanBeRemoved(userEntity)) {
        throw new AmbariException("Could not remove user " + userEntity.getUserName() +
          ". System should have at least one administrator.");
      }
      userDAO.remove(userEntity);
    }
  }
Removes a user from the Ambari database.
<p>
It is expected that the associated user authentication records are removed by this operation
as well.

@param userEntity the user to remove
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java