Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 22 Apr 2005 15:15:17 -0000 1.7 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 17 Feb 2006 12:17:58 -0000 1.8 @@ -12,19 +12,22 @@ cf.package_id, p.instance_name as community_name, sc.node_id as comm_node_id, sa.node_id as as_node_id from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, - site_nodes sa, site_nodes sc, apm_packages p + site_nodes sa, site_nodes sc, apm_packages p, + (select distinct asm.assessment_id + from as_assessment_section_map asm, as_item_section_map ism, + acs_object_party_privilege_map ppm + where ism.section_id = asm.section_id + and ppm.object_id = asm.assessment_id + and ppm.privilege = 'read' + and ppm.party_id = :user_id) s where a.assessment_id = cr.revision_id and cr.revision_id = ci.latest_revision and ci.parent_id = cf.folder_id and cf.package_id in ([join $list_of_package_ids ", "]) and sa.object_id = cf.package_id and sc.node_id = sa.parent_id and p.package_id = sc.object_id - and exists (select 1 - from as_assessment_section_map asm, as_item_section_map ism - where asm.assessment_id = a.assessment_id - and ism.section_id = asm.section_id) - and acs_permission__permission_p (a.assessment_id, :user_id, 'read') = 't' + and s.assessment_id = a.assessment_id order by lower(p.instance_name), lower(cr.title)