@Transactional
  public synchronized void removeMemberFromGroup(GroupEntity groupEntity, UserEntity userEntity)
      throws AmbariException {

    if (isUserInGroup(userEntity, groupEntity)) {
      MemberEntity memberEntity = null;
      for (MemberEntity entity : userEntity.getMemberEntities()) {
        if (entity.getGroup().equals(groupEntity)) {
          memberEntity = entity;
          break;
        }
      }
      userEntity.getMemberEntities().remove(memberEntity);
      groupEntity.getMemberEntities().remove(memberEntity);
      userDAO.merge(userEntity);
      groupDAO.merge(groupEntity);
      memberDAO.remove(memberEntity);
    }
  }
Revokes Ambari Administrator privileges from provided user.

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