Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -N -r1.114.2.9 -r1.114.2.10 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 1 Sep 2020 17:09:32 -0000 1.114.2.9 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 3 Sep 2020 09:16:41 -0000 1.114.2.10 @@ -1766,20 +1766,22 @@ # Is there a user from other authorities having swa admins (having # admin rights on the magic object 'security_context_root')? # - return [db_string admins_left_p { - select case when exists (select 1 - from acs_permissions p, + return [db_0or1row admins_left_p { + select 1 from dual where exists + ( + select 1 + from acs_permissions p, party_approved_member_map m, acs_magic_objects amo, cc_users u - where amo.name = 'security_context_root' - and p.object_id = amo.object_id - and p.grantee_id = m.party_id - and u.user_id = m.member_id - and u.member_state = 'approved' - and u.authority_id <> :authority_id - and acs_permission.permission_p(amo.object_id, u.user_id, 'admin')) then 1 else 0 end - from dual + where amo.name = 'security_context_root' + and p.object_id = amo.object_id + and p.grantee_id = m.party_id + and u.user_id = m.member_id + and u.member_state = 'approved' + and u.authority_id <> :authority_id + and acs_permission.permission_p(amo.object_id, u.user_id, 'admin') + ) }] }