Index: openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql 24 Feb 2005 11:10:31 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/permissions/one-postgresql.xql 7 Aug 2017 23:47:59 -0000 1.8 @@ -12,15 +12,13 @@ - + select grantee_id, grantee_name, privilege - from (select grantee_id, acs_object__name(grantee_id) as grantee_name, - privilege, 1 as counter - from acs_permissions_all - where object_id = :object_id + from ( + select grantee_id, acs_object__name(grantee_id) as grantee_name, privilege, 1 as counter + from acs_permission.permissions_all(:object_id) union all - select grantee_id, acs_object__name(grantee_id) as grantee_name, - privilege, -1 as counter + select grantee_id, acs_object__name(grantee_id) as grantee_name, privilege, -1 as counter from acs_permissions where object_id = :object_id ) dummy group by grantee_id, grantee_name, privilege @@ -53,28 +51,31 @@ - - - select object_id as c_object_id,acs_object__name(object_id) as c_name, object_type as c_type - from acs_objects o - where context_id = :object_id - and exists (select 1 - from acs_permissions_all - where object_id = o.object_id - and grantee_id = :user_id - and privilege = 'admin') - + + + select + o.object_id as c_object_id, + acs_object__name(o.object_id) as c_name, + o.object_type as c_type + from + acs_permission.permission_p_recursive_array(array( + select object_id from acs_objects o where context_id = :object_id + ), :user_id, 'admin') p + join acs_objects o on (p.orig_object_id = o.object_id) + + + - - - select count(*) as num_children - from acs_objects o - where context_id = :object_id and - acs_permission__permission_p(o.object_id, :user_id, 'admin') = 't' + - + select count(*) as num_children + from acs_permission.permission_p_recursive_array(array( + select object_id from acs_objects o where context_id = :object_id + ), :user_id, 'admin') + +