public synchronized void setUserActive(String userName, boolean active) throws AmbariException {
    UserEntity userEntity = userDAO.findUserByName(userName);
    if (userEntity != null) {
      setUserActive(userEntity, active);
    } else {
      throw new AmbariException("User " + userName + " doesn't exist");
    }
  }
Enables/disables user.

@param userName user name
@param active   true if active; false if not active
@throws AmbariException if user does not exist
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/Users.java