Index: openacs-4/packages/bookmarks/www/tree-dynamic-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/tree-dynamic-postgresql.xql,v diff -u -r1.5 -r1.5.4.1 --- openacs-4/packages/bookmarks/www/tree-dynamic-postgresql.xql 22 Sep 2003 16:21:36 -0000 1.5 +++ openacs-4/packages/bookmarks/www/tree-dynamic-postgresql.xql 30 May 2004 05:12:27 -0000 1.5.4.1 @@ -3,33 +3,32 @@ postgresql7.1 - + -select - b.bookmark_id, b.url_id, b.local_title, last_live_date, - last_checked_date, b.parent_id, complete_url, b.folder_p -from +select + b.bookmark_id, b.url_id, b.local_title, last_live_date, + last_checked_date, b.parent_id, complete_url, b.folder_p, + tree_level(b.tree_sortkey) as lev +from ( - select bm.bookmark_id, bm.url_id, bm.local_title, bm.folder_p, - bm.parent_id, bm.owner_id, bm.tree_sortkey - from bm_bookmarks bm, bm_bookmarks bm2 - where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) - and bm2.bookmark_id = :root_id - ) - b left join bm_urls using (url_id) -where exists - ( - select 1 from bm_bookmarks bm, bm_bookmarks bm2 + select bm.bookmark_id, bm.url_id, bm.local_title, bm.folder_p, + bm.parent_id, bm.owner_id, bm.tree_sortkey + from bm_bookmarks bm, bm_bookmarks bm2 where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey) - and bm2.bookmark_id = b.bookmark_id - and acs_permission__permission_p(bm.bookmark_id, :user_id, 'read') = 't' + and bm2.bookmark_id = :root_id ) -and b.bookmark_id <> :root_id + b left join bm_urls using (url_id) +where + exists (select 1 from all_object_party_privilege_map p + where + p.object_id = b.bookmark_id + and p.privilege = 'read' + and p.party_id = :user_id + ) + and b.bookmark_id <> :root_id order by b.tree_sortkey - - + -