Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-oracle.xql 11 Jun 2003 14:35:23 -0000 1.1.4.1 @@ -3,35 +3,12 @@ oracle8.1.6 - + - - declare - cursor v_cursor is - select member_id - from group_member_map - where group_id = :group_id; - begin - if :role = 'read' then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - end loop; - elsif (:role = 'write') then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - end loop; - else - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_admin_presentation'); - end loop; - end if; - end; - + begin + acs_permission.grant_permission(:pres_item_id, :member_id, :permission); + end; - Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3-postgresql.xql 11 Jun 2003 14:35:23 -0000 1.1.4.1 @@ -3,42 +3,12 @@ postgresql7.1 - + - - - select - if :role = ''read'' then - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id,''wp_view_presentation''); - end loop; - else if (:role = ''write'') then - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id, ''wp_view_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_edit_presentation''); - end loop; - else - for record in select member_id - from group_member_map - where group_id = :group_id; - loop - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_view_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_edit_presentation''); - acs_permission__grant_permission(:pres_item_id, c.member_id, -''wp_admin_presentation''); - end loop; - end if; - - + begin + perform acs_permission__grant_permission(:pres_item_id, :member_id, :permission); + return 0; + end; Index: openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.4.1 --- openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl 20 Apr 2001 20:51:24 -0000 1.1.1.1 +++ openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.tcl 11 Jun 2003 14:35:23 -0000 1.1.1.1.4.1 @@ -16,30 +16,15 @@ ad_require_permission $pres_item_id wp_admin_presentation # adds a group of users -db_exec_plsql group_add { - declare - cursor v_cursor is - select member_id - from group_member_map - where group_id = :group_id; - begin - if :role = 'read' then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - end loop; - elsif (:role = 'write') then - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - end loop; - else - for c in v_cursor loop - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_view_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_edit_presentation'); - acs_permission.grant_permission(:pres_item_id, c.member_id, 'wp_admin_presentation'); - end loop; - end if; - end; +db_foreach group_grant { *SQL } { + if {$role == "write"} { + set permission "wp_edit_presentation" + } elseif {$role == "admin"} { + set permission "wp_admin_presentation" + } else { + set permission "wp_view_presentation" + } + db_exec_plsql permission_grant { *SQL } } -ad_returnredirect presentation-acl?[export_url_vars pres_item_id] \ No newline at end of file +ad_returnredirect presentation-acl?[export_url_vars pres_item_id] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/wp-slim/www/presentation-acl-add-group-3.xql'. Fisheye: No comparison available. Pass `N' to diff?