postgresql7.1 select tree_id as link_tree_id from category_trees where acs_permission__permission_p(tree_id,:user_id,'category_tree_write') = 't'