Index: openacs-4/packages/wp-slim/www/presentation-acl-add-3-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-3-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/wp-slim/www/presentation-acl-add-3-oracle.xql 4 Oct 2001 04:23:13 -0000 1.1
+++ openacs-4/packages/wp-slim/www/presentation-acl-add-3-oracle.xql 19 Jun 2002 11:37:28 -0000 1.2
@@ -7,33 +7,9 @@
begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
+ acs_permission.grant_permission(:pres_item_id, :user_id_from_search, :privilege);
end;
-
-
-
-
-
- begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
- end;
-
-
-
-
-
-
-
-
- begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
- end;
-
-
-
-
-
Index: openacs-4/packages/wp-slim/www/presentation-acl-add-3-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-3-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/wp-slim/www/presentation-acl-add-3-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1
+++ openacs-4/packages/wp-slim/www/presentation-acl-add-3-postgresql.xql 19 Jun 2002 11:37:28 -0000 1.2
@@ -5,30 +5,8 @@
- select acs_permission__grant_permission(:pres_item_id,
-:user_id_from_search,'wp_view_presentation');
-
+ select acs_permission__grant_permission(:pres_item_id, :user_id_from_search, :privilege);
-
-
-
-
- select acs_permission__grant_permission(:pres_item_id,
-:user_id_from_search, 'wp_view_presentation');
-
-
-
-
-
-
-
-
- select acs_permission__grant_permission(:pres_item_id,
-:user_id_from_search, 'wp_view_presentation');
-
-
-
-
Index: openacs-4/packages/wp-slim/www/presentation-acl-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-add-3.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/wp-slim/www/presentation-acl-add-3.tcl 20 Apr 2001 20:51:24 -0000 1.1
+++ openacs-4/packages/wp-slim/www/presentation-acl-add-3.tcl 19 Jun 2002 11:37:28 -0000 1.2
@@ -30,33 +30,34 @@
ns_sendmail $email_from_search $sender_email "WimpyPoint Authorization" "$message"
}
+set privilege_list "wp_view_presentation"
+if { [string equal $role "write"] } {
+ lappend privilege_list "wp_edit_presentation"
+}
+if { [string equal $role "write"] } {
+ lappend privilege_list "wp_edit_presentation"
+}
+
switch $role {
"read" {
- db_exec_plsql grant_privilege {
- begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
- end;
- }
+ set privilege_list { wp_view_presentation }
}
-
"write" {
- db_exec_plsql grant_privilege {
- begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_edit_presentation');
- end;
- }
+ set privilege_list { wp_view_presentation wp_edit_presentation }
}
-
"admin" {
- db_exec_plsql grant_privilege {
- begin
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_view_presentation');
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_edit_presentation');
- acs_permission.grant_permission(:pres_item_id, :user_id_from_search, 'wp_admin_presentation');
- end;
- }
+ set privilege_list { wp_view_presentation wp_edit_presentation wp_admin_presentation }
}
}
-ad_returnredirect presentation-acl?[export_url_vars pres_item_id]
\ No newline at end of file
+db_transaction {
+ foreach privilege $privilege_list {
+ db_exec_plsql grant_privilege {
+ begin
+ acs_permission.grant_permission(:pres_item_id, :user_id_from_search, :privilege);
+ end;
+ }
+ }
+}
+
+ad_returnredirect presentation-acl?[export_vars -url { pres_item_id }]
\ No newline at end of file
Index: openacs-4/packages/wp-slim/www/presentation-acl-delete-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/wp-slim/www/presentation-acl-delete-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/wp-slim/www/presentation-acl-delete-postgresql.xql 4 Oct 2001 04:23:13 -0000 1.1
+++ openacs-4/packages/wp-slim/www/presentation-acl-delete-postgresql.xql 19 Jun 2002 11:37:28 -0000 1.2
@@ -5,15 +5,10 @@
-
-create function inline_0()
-returns integer as'
-
declare
owner_id integer;
-
-
+begin
select creation_user into owner_id
from acs_objects
where object_id = :pres_item_id;
@@ -22,16 +17,11 @@
PERFORM acs_permission__revoke_permission(:pres_item_id, :user_id, :privilege);
end if;
-return 0;
-
-end;' language 'plpgsql';
-
-select inline_0();
-drop function inline_0();
-
-
+ return 0;
+end;
+
\ No newline at end of file