Index: openacs-4/packages/dotlrn/sql/postgresql/security-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/security-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn/sql/postgresql/security-create.sql	9 Aug 2002 18:39:25 -0000	1.3
+++ openacs-4/packages/dotlrn/sql/postgresql/security-create.sql	4 Dec 2002 09:51:03 -0000	1.4
@@ -28,59 +28,68 @@
 -- Security Setup for dotLRN
 -- privileges, privilege inheritance
 --
-begin;
+create function inline0()
+returns integer as '
+begin
         -- the ability to browse dotLRN in general
-        select acs_privilege__create_privilege('dotlrn_browse');
+        perform acs_privilege__create_privilege(''dotlrn_browse'');
 
         -- the ability to even view that a community exists
-        select acs_privilege__create_privilege('dotlrn_view_community');
+        perform acs_privilege__create_privilege(''dotlrn_view_community'');
 
         -- the ability to participate in a community
-        select acs_privilege__create_privilege('dotlrn_edit_community');
+        perform acs_privilege__create_privilege(''dotlrn_edit_community'');
 
         -- the ability to admin a community
-        select acs_privilege__create_privilege('dotlrn_admin_community');
+        perform acs_privilege__create_privilege(''dotlrn_admin_community'');
 
         -- the ability to create a community
-        select acs_privilege__create_privilege('dotlrn_create_community');
+        perform acs_privilege__create_privilege(''dotlrn_create_community'');
 
         -- the ability to even view a community type
-        select acs_privilege__create_privilege('dotlrn_view_community_type');
+        perform acs_privilege__create_privilege(''dotlrn_view_community_type'');
 
         -- the ability to admin a community type
-        select acs_privilege__create_privilege('dotlrn_admin_community_type');
+        perform acs_privilege__create_privilege(''dotlrn_admin_community_type'');
         
         -- the ability to create a community type
-        select acs_privilege__create_privilege('dotlrn_create_community_type');
+        perform acs_privilege__create_privilege(''dotlrn_create_community_type'');
 
+        -- the ability to spam a community
+        perform acs_privilege__create_privilege(''dotlrn_spam_community'');
+
         -- temporarily drop this trigger to avoid a data-change violation 
         -- on acs_privilege_hierarchy_index while updating the child privileges.
 
         drop trigger acs_priv_hier_ins_del_tr on acs_privilege_hierarchy;
 
         -- Consistent permissions
-        select acs_privilege__add_child('dotlrn_edit_community', 'dotlrn_view_community');
-        select acs_privilege__add_child('dotlrn_admin_community', 'dotlrn_edit_community');
+        perform acs_privilege__add_child(''dotlrn_edit_community'', ''dotlrn_view_community'');
+        perform acs_privilege__add_child(''dotlrn_admin_community'', ''dotlrn_edit_community'');
+        perform acs_privilege__add_child(''dotlrn_admin_community'', ''dotlrn_spam_community'');
 
         -- inheritance
-        select acs_privilege__add_child('create', 'dotlrn_create_community_type');
-        select acs_privilege__add_child('create', 'dotlrn_create_community');
-        select acs_privilege__add_child('write', 'dotlrn_edit_community');
-        select acs_privilege__add_child('read', 'dotlrn_view_community');
-        select acs_privilege__add_child('read', 'dotlrn_view_community_type');
-        select acs_privilege__add_child('admin', 'dotlrn_admin_community');
-        select acs_privilege__add_child('admin', 'dotlrn_admin_community_type');
+        perform acs_privilege__add_child(''create'', ''dotlrn_create_community_type'');
+        perform acs_privilege__add_child(''create'', ''dotlrn_create_community'');
+        perform acs_privilege__add_child(''write'', ''dotlrn_edit_community'');
+        perform acs_privilege__add_child(''read'', ''dotlrn_view_community'');
+        perform acs_privilege__add_child(''read'', ''dotlrn_view_community_type'');
+        perform acs_privilege__add_child(''admin'', ''dotlrn_admin_community'');
+        perform acs_privilege__add_child(''admin'', ''dotlrn_admin_community_type'');
+        -- for now, we only want admins to be able to browse by default
+        perform acs_privilege__add_child(''admin'', ''dotlrn_browse'');
 
         -- re-enable the trigger before the last insert to force the 
         -- acs_privilege_hierarchy_index table to be updated.
-
         create trigger acs_priv_hier_ins_del_tr after insert or delete
         on acs_privilege_hierarchy for each row
         execute procedure acs_priv_hier_ins_del_tr ();
 
-        -- for now, we only want admins to be able to browse by default
-        select acs_privilege__add_child('admin', 'dotlrn_browse');
-
         -- no default permissions
+        return 0;
+end;' language 'plpgsql';
 
-end;
+select inline0();
+drop function inline0();
+
+
