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.6 -r1.7 --- openacs-4/packages/dotlrn/sql/postgresql/security-create.sql 8 Aug 2006 21:26:22 -0000 1.6 +++ openacs-4/packages/dotlrn/sql/postgresql/security-create.sql 1 Nov 2013 21:08:29 -0000 1.7 @@ -28,56 +28,56 @@ -- Security Setup for dotLRN -- privileges, privilege inheritance -- -create function inline0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline0() RETURNS integer AS $$ +BEGIN -- the ability to browse dotLRN in general - perform acs_privilege__create_privilege(''dotlrn_browse''); + perform acs_privilege__create_privilege('dotlrn_browse'); -- the ability to even view that a community exists - perform acs_privilege__create_privilege(''dotlrn_view_community''); + perform acs_privilege__create_privilege('dotlrn_view_community'); -- the ability to participate in a community - perform acs_privilege__create_privilege(''dotlrn_edit_community''); + perform acs_privilege__create_privilege('dotlrn_edit_community'); -- the ability to admin a community - perform acs_privilege__create_privilege(''dotlrn_admin_community''); + perform acs_privilege__create_privilege('dotlrn_admin_community'); -- the ability to create a community - perform acs_privilege__create_privilege(''dotlrn_create_community''); + perform acs_privilege__create_privilege('dotlrn_create_community'); -- the ability to even view a community type - perform acs_privilege__create_privilege(''dotlrn_view_community_type''); + perform acs_privilege__create_privilege('dotlrn_view_community_type'); -- the ability to admin a community type - perform acs_privilege__create_privilege(''dotlrn_admin_community_type''); + perform acs_privilege__create_privilege('dotlrn_admin_community_type'); -- the ability to create a community type - perform 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''); + perform acs_privilege__create_privilege('dotlrn_spam_community'); -- Consistent permissions - 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''); + 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 - 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''); + 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''); + perform acs_privilege__add_child('admin', 'dotlrn_browse'); -- no default permissions return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline0(); drop function inline0();