List sources = new ArrayList(); List userGroups = getUserGroups();
Criteria crit = new Criteria(); crit.addJoin( ContentSourcePeer.CONTENT_SOURCE_ID, UserGroupContentSourceLnkPeer.CONTENT_SOURCE_ID ); crit.addJoin( UserGroupContentSourceLnkPeer.USER_GROUP_ID, UserGroupLnkPeer.USER_ID ); crit.add( UserGroupLnkPeer.USER_ID, this.getUserId() );
    public List getContentSources() throws TorqueException    {        List sources = new ArrayList();        List userGroups = getUserGroups();        //add all content sources for all user group this user is member of        for (Iterator it = userGroups.iterator(); it.hasNext();)        {            sources.addAll( ((UserGroup) it.next()).getContentSources() );        }                return sources;    }