class EcmFileParticipantService {

    @Transactional(rollbackFor = Exception.class)
    public void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants,
            List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted)
    {
        if (acmContainer == null)
        {
            log.warn("Null container passed in " + getClass().getName() + ".inheritParticipantsFromAssignedObject()");
            return;
        }

        if (acmContainer.getFolder() != null)
        {
            inheritParticipantsFromAssignedObject(assignedObjectParticipants,
                    originalAssignedObjectParticipants, acmContainer.getFolder(), restricted);
        }
        if (acmContainer.getAttachmentFolder() != null
                && (acmContainer.getFolder() == null
                        || (acmContainer.getAttachmentFolder() != acmContainer.getFolder()
                                && acmContainer.getAttachmentFolder().getId() != null &&
                                !acmContainer.getAttachmentFolder().getId().equals(acmContainer.getFolder().getId()))))
        {
            inheritParticipantsFromAssignedObject(assignedObjectParticipants,
                    originalAssignedObjectParticipants, acmContainer.getAttachmentFolder(), restricted);
        }
    }

}