Index: openacs-4/packages/categories/lib/list-categories.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/lib/list-categories.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/categories/lib/list-categories.tcl	10 Mar 2005 18:27:41 -0000	1.1
+++ openacs-4/packages/categories/lib/list-categories.tcl	17 Mar 2005 08:33:59 -0000	1.2
@@ -5,16 +5,22 @@
 if {![exists_and_not_null orderby]} {
     set orderby "object_title"
 }
+set user_id [ad_conn user_id]
 
 # Get category data.
 set counts {}
 set node_id [ad_conn node_id]
-set packages [categories-ui::util::packages -node_id $node_id]
+set packages [subsite::util::packages -node_id $node_id]
 db_foreach category_count "
     SELECT c.category_id as catid, count(*) as count
     FROM category_object_map c, acs_objects o
     where c.object_id = o.object_id
     and o.package_id in ([join $packages ,])
+    and exists (select 1 
+                  from acs_object_party_privilege_map pm
+                 where pm.object_id = c.object_id
+                   and pm.party_id = :user_id
+                   and pm.privilege = 'read')
     group by c.category_id
 " { 
     lappend counts $catid $count