Index: openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-oracle.xql,v
diff -u -r1.3 -r1.3.6.1
--- openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql	4 Dec 2001 00:20:47 -0000	1.3
+++ openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql	23 Mar 2004 15:30:32 -0000	1.3.6.1
@@ -50,9 +50,6 @@
                   where group_id = :group_id and rel_type = :rel_type
                   UNION ALL
                   select to_number(:group_id) from dual) m,
-                 (select object_id
-                  from all_object_party_privilege_map
-                  where party_id = :user_id and privilege = 'read') perm,
                  (select party_id
                   from rc_parties_in_required_segs
                   where group_id = :group_id 
@@ -61,7 +58,6 @@
                  persons
             where p.party_id = m.element_id(+)
               and m.element_id is null
-              and p.party_id = perm.object_id
               and p.party_id = pirs.party_id $scope_clause
               and p.party_id = groups.group_id(+)
               and p.party_id = persons.person_id(+)
Index: openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-postgresql.xql,v
diff -u -r1.5 -r1.5.4.1
--- openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql	13 Mar 2002 22:50:53 -0000	1.5
+++ openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql	23 Mar 2004 15:30:32 -0000	1.5.4.1
@@ -52,9 +52,6 @@
                   where group_id = :group_id and rel_type = :rel_type
                   UNION ALL
                   select :group_id::integer ) m on (p.party_id = m.element_id) cross join
-                 (select object_id
-                  from all_object_party_privilege_map
-                  where party_id = :user_id and privilege = 'read') perm cross join
                  (select party_id
                   from rc_parties_in_required_segs
                   where group_id = :group_id 
@@ -63,7 +60,6 @@
 		left join persons on (p.party_id = persons.person_id)
             where 
               m.element_id is null
-              and p.party_id = perm.object_id
               and p.party_id = pirs.party_id $scope_clause
     
       </querytext>
Index: openacs-4/packages/acs-subsite/www/admin/relations/add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/add.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/acs-subsite/www/admin/relations/add.tcl	27 Feb 2004 11:23:36 -0000	1.8
+++ openacs-4/packages/acs-subsite/www/admin/relations/add.tcl	23 Mar 2004 15:30:32 -0000	1.8.2.1
@@ -217,41 +217,7 @@
     # easy for us to find all the queries that we know may be unscalable.
     # This query has been tuned as well as possible given development 
     # time constraints, but more tuning may be necessary.
-    set party_option_list [db_list_of_lists select_parties "
-            select DISTINCT
-                   decode(groups.group_id,
-                          null, decode(persons.person_id, 
-                                       null, 'INVALID',
-                                       persons.first_names || ' ' || persons.last_name),
-                          groups.group_name) as party_name,
-                   p.party_id
-            from (select o.object_id as party_id
-                  from acs_objects o,
-                       (select object_type from acs_object_types
-                        start with $start_with
-                        connect by prior object_type = supertype) t
-                  where o.object_type = t.object_type) p,
-                 (select element_id
-                  from group_element_map
-                  where group_id = :group_id and rel_type = :rel_type
-                  UNION ALL
-                  select to_number(:group_id) from dual) m,
-                 (select object_id
-                  from all_object_party_privilege_map
-                  where party_id = :user_id and privilege = 'read') perm,
-                 (select party_id
-                  from rc_parties_in_required_segs
-                  where group_id = :group_id 
-                    and rel_type = :rel_type) pirs $scope_query,
-                 groups,
-                 persons
-            where p.party_id = m.element_id(+)
-              and m.element_id is null
-              and p.party_id = perm.object_id
-              and p.party_id = pirs.party_id $scope_clause
-              and p.party_id = groups.group_id(+)
-              and p.party_id = persons.person_id(+)
-    "]
+    set party_option_list [db_list_of_lists select_parties {}]
 
     if { [llength $party_option_list] == 0 } {
 	ad_return_template add-no-valid-parties