oacs_dav::children_have_permission_p (public)
oacs_dav::children_have_permission_p [ -user_id user_id ] \ [ -item_id item_id ] [ -privilege privilege ]
Defined in packages/oacs-dav/tcl/oacs-dav-procs.tcl
Check permission on child items of item_id for user_id with privilege
- Switches:
- -user_id (optional)
- -item_id (optional)
- -privilege (optional)
- Returns:
- returns 0 if user does not have privilege over all children otherwise return 1
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- oacs_dav_children_have_permission_p
Source code: set child_count [db_string child_perms ""] ns_log notice "\n ----- \n oacs_dav::children_have_permission_p \n child_count = $child_count \n ----- \n" incr child_count [db_string revision_perms ""] ns_log notice "\n ----- \n oacs_dav::children_have_permission_p \n child_count = $child_count \n ----- \n" ns_log notice "\n ----- \n oacs_dav::children_have_permission_p \n return [expr {$child_count == 0}] \n ----- \n" return [expr {$child_count == 0}]Generic XQL file: packages/oacs-dav/tcl/oacs-dav-procs.xql
PostgreSQL XQL file: <fullquery name="oacs_dav::children_have_permission_p.child_perms"> <querytext> select count(*) from cr_items c1, cr_items c2 where c2.item_id = :item_id and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey) and not acs_permission__permission_p(c1.item_id, :user_id, :privilege) </querytext> </fullquery> <fullquery name="oacs_dav::children_have_permission_p.revision_perms"> <querytext> select count(*) from cr_revisions where item_id = :item_id and not acs_permission__permission_p(revision_id, :user_id, 'delete') </querytext> </fullquery>packages/oacs-dav/tcl/oacs-dav-procs-postgresql.xql
Oracle XQL file: <fullquery name="oacs_dav::children_have_permission_p.child_perms"> <querytext> select count(*) from (select item_id from cr_items connect by prior item_id = parent_id start with item_id = :item_id) where not exists (select 1 from acs_object_party_privilege_map m where m.object_id = cr_items.item_id and m.party_id = :user_id and m.privilege = :privilege) </querytext> </fullquery> <fullquery name="oacs_dav::children_have_permission_p.revision_perms"> <querytext> select count(*) from cr_revisions where item_id = :item_id and not exists (select 1 from acs_object_party_privilege_map m where m.object_id = revision_id and m.party_id = :user_id and m.privilege = 'delete') </querytext> </fullquery>packages/oacs-dav/tcl/oacs-dav-procs-oracle.xql