Index: openacs-4/packages/acs-subsite/tcl/group-type-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs-oracle.xql,v diff -u -N -r1.3 -r1.3.2.1 --- openacs-4/packages/acs-subsite/tcl/group-type-procs-oracle.xql 11 Dec 2018 14:14:41 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs-oracle.xql 18 Mar 2019 16:07:55 -0000 1.3.2.1 @@ -3,20 +3,6 @@ oracle8.1.6 - - - - select case when exists (select 1 - from acs_objects o - where acs_permission.permission_p(o.object_id, :user_id, 'delete') = 'f' - and o.object_type = :group_type) - then 0 else 1 end - from dual - - - - - @@ -89,15 +75,4 @@ - - - select distinct o.object_id - from acs_objects o, acs_object_party_privilege_map perm - where perm.object_id = o.object_id - and perm.party_id = :user_id - and perm.privilege = 'delete' - and o.object_type = :group_type - - - Index: openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql,v diff -u -N -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql 11 Dec 2018 14:14:41 -0000 1.5 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs-postgresql.xql 18 Mar 2019 16:07:55 -0000 1.5.2.1 @@ -3,20 +3,6 @@ postgresql7.1 - - - - select case when exists (select 1 - from acs_objects o - where acs_permission__permission_p(o.object_id, :user_id, 'delete') = 'f' - and o.object_type = :group_type) - then 0 else 1 end - - - - - - @@ -94,13 +80,4 @@ - - - select o.object_id - from acs_objects o - where o.object_type = :group_type - and acs_permission__permission_p(o.object_id, :user_id, 'delete') - - - Index: openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl,v diff -u -N -r1.12 -r1.12.2.1 --- openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 11 Dec 2018 14:14:41 -0000 1.12 +++ openacs-4/packages/acs-subsite/tcl/group-type-procs.tcl 18 Mar 2019 16:07:55 -0000 1.12.2.1 @@ -24,12 +24,17 @@ } { if { $user_id eq "" } { - if { ![ad_conn isconnected] } { - error "group_type::drop_all_groups_p: User ID not specified and we have no connection from which to obtain current user ID.\n" + if { ![ns_conn isconnected] } { + error "group_type::drop_all_groups_p: User ID not specified and we have no connection from which to obtain current user ID." } set user_id [ad_conn user_id] } - return [db_string group_exists_p {}] + return [db_string group_exists_p { + select exists (select 1 from acs_objects o + where object_type = :group_type + and not acs_permission.permission_p(o.object_id, :user_id, 'delete')) + from dual + }] } @@ -213,7 +218,12 @@ db_transaction { # First delete the groups if { $package_name ne "" } { - foreach group_id [db_list select_group_ids {}] { + foreach group_id [db_list select_group_ids { + select o.object_id + from acs_objects o + where o.object_type = :group_type + and acs_permission.permission_p(o.object_id, :user_id, 'delete') + }] { group::delete $group_id }