class SecurityServiceImpl extends RemoteServiceServlet implements SecurityService {

	@Override
	public void removeFromGroup(long groupId, long[] userIds) throws ServerException {
		ServiceUtil.checkMenu(getThreadLocalRequest(), Menu.ADMINISTRATION);

		UserDAO userDao = (UserDAO) Context.get().getBean(UserDAO.class);
		GroupDAO groupDao = (GroupDAO) Context.get().getBean(GroupDAO.class);
		Group group = groupDao.findById(groupId);
		for (long id : userIds) {
			User user = userDao.findById(id, true);
			user.removeGroup(group.getId());
			try {
				userDao.store(user);
			} catch (PersistenceException e) {
				log.error(e.getMessage(), e);
			}
		}
	}

}