for(Iterator i = u.getGroups(); i.hasNext(); ) { String g = (String)i.next(); if(!(old.hasGroup(g) || manager.hasAdminPrivileges(user))) throw new XMLDBException( ErrorCodes.PERMISSION_DENIED, "not allowed to change group memberships"); }
	public void updateUser(User u) throws XMLDBException {		org.exist.security.SecurityManager manager = pool.getSecurityManager();		if (!(u.getName().equals(user.getName())			|| manager.hasAdminPrivileges(user)))			throw new XMLDBException(				ErrorCodes.PERMISSION_DENIED,				" you are not allowed to change this user");		User old = manager.getUser(u.getName());		if (old == null)			throw new XMLDBException(				ErrorCodes.PERMISSION_DENIED,				"user " + u.getName() + " does not exist");		u.setUID(old.getUID());		manager.setUser(u);	}