@Transactional
  public synchronized void removeMemberFromGroup(String groupName, String userName)
    throws AmbariException {

    final GroupEntity groupEntity = groupDAO.findGroupByName(groupName);
    if (groupEntity == null) {
      throw new AmbariException("Group " + groupName + " doesn't exist");
    }

    UserEntity userEntity = userDAO.findUserByName(userName);
    if (userEntity == null) {
      throw new AmbariException("User " + userName + " doesn't exist");
    }

    removeMemberFromGroup(groupEntity, userEntity);
  }
Revokes Ambari Administrator privileges from provided user.

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