}  if (locked) { throw new SecurityViolation("Object locked! " + "Cannot change group for entity:" + obj);
	protected boolean managedGroup(boolean locked, boolean privileged,			IObject obj, Details previousDetails, Details currentDetails,			Details newDetails) {		// previous and current have different ids. either change it and return		// true if permitted, or throw an exception.		if (!idEqual(previousDetails.getGroup(), currentDetails.getGroup())) {			if (locked) {				throw new SecurityViolation("Cannot change group for entity:"						+ obj);			}			// even root can't set them to null.			else if (currentDetails.getGroup() == null) {				newDetails.setGroup(previousDetails.getGroup());				return true;			}			// if user is a member of the group or the current user is an admin			// or if the entity has been marked as privileged, then use the			// current group.			else if (memberOfGroups().contains(					currentDetails.getGroup().getId())					|| currentUserIsAdmin() || privileged) {				newDetails.setGroup(currentDetails.getGroup());				return true;			}			// everyone else can't change them at all.			else {				throw new SecurityViolation(String.format(						"You are not authorized to change "								+ "the group for %s from %s to %s", obj,						previousDetails.getGroup(), currentDetails.getGroup()));			}		}		// previous and current are the same, but we need to set		// that value on newDetails.		else {			// This doesn't need to return true, because it'll only			// be used if something else was changed.			newDetails.setGroup(previousDetails.getGroup());		}		return false;	}