Index: openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql 13 Dec 2001 02:00:01 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/permissions/index-postgresql.xql 16 Jan 2003 13:40:36 -0000 1.5 @@ -5,13 +5,16 @@ - - select distinct o.object_id, acs_object__name(o.object_id) as name - from acs_objects o, all_object_party_privilege_map map - where map.object_id = o.object_id - and map.party_id = :user_id - and map.privilege = 'admin' - + select o.object_id, acs_object__name(o.object_id) as name, context_id, object_type, + (case when o.object_id = :root then 0 else 1 end) as child + from acs_objects o + where exists ( SELECT 1 + FROM acs_permissions_all map + WHERE map.object_id = o.object_id + and map.grantee_id = :user_id + and map.privilege = 'admin') + and (o.object_id = :root or o.context_id = :root) + order by child, object_type, name