[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2749] trunk



Revision: 2749
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2749&view=rev
Author:   einhverfr
Date:     2009-08-10 00:42:38 +0000 (Mon, 10 Aug 2009)

Log Message:
-----------
 * Correcting load issues with db scripts
 * Correcting issues with db setup wizard (initiate.pl)
 * documenting db setup wizard
 * Renaming roles so module roles are grouped together per jeffk's request

Modified Paths:
--------------
    trunk/INSTALL
    trunk/LedgerSMB/Initiate.pm
    trunk/bin/initiate.pl
    trunk/sql/Pg-database.sql
    trunk/sql/modules/LOADORDER
    trunk/sql/modules/Payment.sql
    trunk/sql/modules/Reconciliation.sql
    trunk/sql/modules/Roles.sql

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/INSTALL	2009-08-10 00:42:38 UTC (rev 2749)
@@ -31,7 +31,7 @@
 /path/to/ledgersmb13 unless otherwise noted.
 
 
-Automating Installation
+Automated Installation
 -----------------------
 
 You can extract the commands in this document with:  $ grep -e '^\$' INSTALL
@@ -39,6 +39,7 @@
 This provides a decent approximation of what would be required for a scripted
 install as of this writing.
 
+Also some portions of the installation are also fairly automated already.
 
 Apache Configuration
 ====================
@@ -200,6 +201,14 @@
 works, but without opening up the database to unneccessary network access.
 
 
+Automated PostgreSQL Database Setup
+===================================
+Point your browser to http://[yourhost]/path/to/ledgersmb/initiate.pl
+
+You will see an HTTP authentication prompt.  Enter credentials for the database 
+superuser (for example "postgres" user).  Then follow the prompts and fill in 
+the information.
+
 Installing PostgreSQL Contrib Function Libraries (Not Optional)
 ===============================================================
 
@@ -241,17 +250,6 @@
 loading. Instruct the user how to run them.
 
 
-Configure a LedgerSMB PostgreSQL role
-=====================================
-
-Create the ledgersmb PostgreSQL role (optional):
-
-$ createuser --no-superuser --createdb --no-createrole -U postgres --pwprompt --encrypted ledgersmb
-
-
-Make a note of the password you enter, we'll refer to it as LSMB_PASSWORD.
-
-
 Configure a LedgerSMB Company Database
 ======================================
 
@@ -273,40 +271,13 @@
 
 
 Apply the in-development SQL statements in the files /path/to/ledgersmb13/sql/modules/ to
-the company database, in exactly the following order:
+the company database, in exactly the order specified in sql/modules/LOADORDER:
 
 $ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Drafts.sql
 $ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/chart.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Account.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Session.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Business_type.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Location.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Company.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Customer.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Date.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Defaults.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Settings.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Employee.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Entity.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Payment.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Person.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Report.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Voucher.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Reconciliation.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Inventory.sql
-$ psql -U postgres -d mycompany -f /path/to/ledgersmb13/sql/modules/Vendor.sql
 
-Note: The above files are manageable sections of the LedgerSMB database logic in
-active development for LedgerSMB-1.3. Later in the release cycle, their contents
-will move to the main Pg-database.sql.
+etc.
 
-At the time of this writing, the following files are in an earlier state of
-development and not ready to be loaded as part of this INSTALL:
-
-admin.sql
-security.sql
-
-
 Load a template Chart of Accounts
 ---------------------------------
 

Modified: trunk/LedgerSMB/Initiate.pm
===================================================================
--- trunk/LedgerSMB/Initiate.pm	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/LedgerSMB/Initiate.pm	2009-08-10 00:42:38 UTC (rev 2749)
@@ -177,11 +177,6 @@
       unless $form->{database};
 
      
-    $form->error( __FILE__ . ':' . __LINE__ . ': '
-          . $locale->text('Database Driver Missing!') )
-      unless $form->{driver};
-
-    
     $form->{dbhost}=~s/ //g;
 
    
@@ -226,56 +221,78 @@
         }
     }
 
-
-
-
 }
 
 
 sub save_database
 {
 
-		my($self,$form)..hidden..;
+	my($self,$form)..hidden..;
+	# check all files exist and valids (contrib files , pgdabase.sql and modules and chart accounts etc)
 
-		# check all files exist and valids (contrib files , pgdabase.sql and modules and chart accounts etc)
+	my @contrib=LedgerSMB::Initiate->check_contrib_valid_exist($form);   #check contrib files
 
-		my @contrib=LedgerSMB::Initiate->check_contrib_valid_exist($form);   #check contrib files
+	my @postsql=LedgerSMB::Initiate->check_Pg_database_valid_exist($form); #check sql/Pg-databse.sql files
 
-		my @postsql=LedgerSMB::Initiate->check_Pg_database_valid_exist($form); #check sql/Pg-databse.sql files
+	my @sqlmodules=LedgerSMB::Initiate->check_sql_modules_valid_exist($form);  #check sql/modules/readme file content exist or not
 
-		my @sqlmodules=LedgerSMB::Initiate->check_sql_modules_valid_exist($form);  #check sql/modules/readme file content exist or not
+	my @chartgififiles=LedgerSMB::Initiate->merge_chart_gifi_valid_exist($form);   # check sql/coa/charts and sql/coa/gifi files
 
-		my @chartgififiles=LedgerSMB::Initiate->merge_chart_gifi_valid_exist($form);   # check sql/coa/charts and sql/coa/gifi files
+	my @totalexecutable_files;
+	push(@totalexecutable_files,@contrib);
+	push(@totalexecutable_files,@postsql);
+	push(@totalexecutable_files,@sqlmodules);
+	push(@totalexecutable_files,@chartgififiles);
 
-		my @totalexecutable_files;
-
-		push(@totalexecutable_files,@contrib);
-		push(@totalexecutable_files,@postsql);
-		push(@totalexecutable_files,@sqlmodules);
-		push(@totalexecutable_files,@chartgififiles);
-
 		# Now all the files are found now start execution process(Stages)
 
 		#Stage 1 -   Create the databse $form->{database}
 
-		LedgerSMB::Initiate->create_database($form,$form->{dbh},$form->{database},$form->{username}); 
+	LedgerSMB::Initiate->create_database($form,$form->{dbh},$form->{database},$form->{username}); 
 		
 		#Stage 2 -  CReate the language plpgsql
 	
-		$form->{newdbh}=LedgerSMB::Initiate->handle_create_language($form);
+	$form->{newdbh}=LedgerSMB::Initiate->handle_create_language($form);
 		
 		#stage 3 -  Execute series of files which are located in array @totalexecutable_files in the database $form->{newdbh}
 
-		LedgerSMB::Initiate->run_all_sql_scripts($form,..hidden..);
+	LedgerSMB::Initiate->run_all_sql_scripts($form,..hidden..);
 
 		#Stage -  Wind up completed the task
+	process_roles($form);
+}
 
+sub process_roles {
+	my ($form) = @_;
+	print STDERR "loading roles............\n";
+	LedgerSMB::Initiate->getdbh($form);
+	open (PSQL, '|-', 'psql') || $form->error($locale->text("Couldn't open psql"));
+	my $company = $form->{company};
 
-						
+	open (ROLEFILE, '<', 'sql/modules/Roles.sql') || $form->error($locale->text("Couldn't open Roles.sql"));
 
+	while ($roleline = <ROLEFILE>){
+		$roleline =~ s/<\?lsmb dbname \?>/$company/;
+		print PSQL $roleline;
+	}
+	#create admin user 
+	my $query;
+	if ($form->{createuser}){
+		$query = qq| create user | . 
+			$form->{newdbh}->quote_identifier($form->{admin_username}) .
+			qq| WITH PASSWORD | .
+			$form->{newdbh}->quote($form->{admin_password}) .
+			qq| IN ROLE | .
+			$form->{newdbh}->quote_identifier("lsmb_${company}__users_manage");
+	} else {
+		$query = "GRANT " .
+			$form->{newdbh}->quote_identifier("lsmb_${company}__users_manage")  . 
+			" TO " .
+			$form->{newdbh}->quote_identifier($form->{admin_username});
+	}
+	print PSQL $query;
 }
 
-
 sub run_all_sql_scripts
 {
 
@@ -283,6 +300,7 @@
 
 	foreach $dbfile(@$totalexcfiles)
 	{
+		print STDERR "Loading $dbfile\n";
 
 		LedgerSMB::Initiate->run_db_file($form,$dbfile);
 
@@ -296,10 +314,7 @@
 {
 
  	my($self,$form,$dbfile)..hidden..;
-	
-	my $newdbh=$form->{newdbh};
-
-         system("psql < $dbfile");
+	system("psql < $dbfile");
 }
 
 
@@ -460,7 +475,7 @@
 	my ($self,$form)..hidden..;
 
 	$locale=$form->{locale};
-        
+       	my @dest; 
 	my $dir=$ENV{SCRIPT_FILENAME};
 
 	my $dir = "sql/modules/";
@@ -485,7 +500,6 @@
 	
 	
 	
-	
 	return(@dest);
 	
 	
@@ -497,6 +511,8 @@
 {
 
 	my ($self,$form)..hidden..;
+	my $coa = $form->{coa} || 'General';
+	$coa = "$coa.sql" unless $coa =~ /\.sql$/;
         
 	$locale=$form->{locale};
 
@@ -509,39 +525,19 @@
 	my $chartdir=$dir."chart/";
 	
 	my $gifidir=$dir."gifi/";
+	@chartdir = LedgerSMB::Initiate->read_directory($form, $chartdir);
 
-
-	my @chartdir=LedgerSMB::Initiate->read_directory($form,$chartdir);
-
-	@chartdir=grep /\.sql$/,@chartdir;
-	
-
-
-	my @gifidir;
-
-	if($form->{gifiaccount}==2)
-	{
-	    @gifidir=LedgerSMB::Initiate->read_directory($form,$gifidir);
-	    @gifidir=grep /\.sql$/,@gifidir;
-	   	
-        }   
-
-
         my @dest;	
 
         my $i;
-
 	for($i=0;$i<=$#chartdir;$i++)
 	{
-	  
-		$dest[$i]=$chartdir.$chartdir[$i];
-	
+		$dest[$i]=$chartdir.$chartdir[$i] if $chartdir[$i] = $coa;
 	}
-
 	for(my $j=0;$j<=$#gifidir;$j++,$i++)
 	{
 	  
-		$dest[$i]=$gifidir.$gifidir[$j];
+		$dest[$i]=$chartdir.$gifidir[$i] if $gifidir[$i] = $coa;
 	
 	}
 

Modified: trunk/bin/initiate.pl
===================================================================
--- trunk/bin/initiate.pl	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/bin/initiate.pl	2009-08-10 00:42:38 UTC (rev 2749)
@@ -141,10 +141,6 @@
 		<button type="submit" class="submit" name="action" value="initiate_database">|
       . $locale->text('Initiate Database')
       . qq|</button>
-		<button type="submit" class="submit" name="action" value="view_database">|
-      . $locale->text('View Initialized Databases')
-      . qq|</button>
-
 		<button type="submit" class="submit" name="action" value="logout">|
       . $locale->text('Logout')
       . qq|</button>
@@ -260,10 +256,6 @@
 						<td><input name="database" value="$myconfig->{database}" /></td>
 					</tr>
 					<tr>
-						<th align="right">| . $locale->text('Driver - Pg') . qq|</th>
-						<td><input name="driver" class="checkbox" type="checkbox" value="1">$myconfig->{driver}</td>
-					</tr>
-					<tr>
 						<th align="right">| . $locale->text('Host') . qq|</th>
 						<td><input name="dbhost" value="$myconfig->{host}" /></td>
 					</tr>
@@ -318,9 +310,20 @@
 						<th align="right">| . $locale->text('Gifi Account') . qq|</th>
 						<td><input name="gifiaccount" class="checkbox" type="checkbox" value="2">$myconfig->{gifiaccount}</td>
 					</tr>
-
-
+					<tr><th align="right">|. $locale->text('Chart Name') .qq|</th>
+						<td><input name="coa" type="text" size="32"></td>
 				</table>
+					<tr class="listheading">
+						<th colspan="2">|.
+						$locale->text('Admin User').
+						qq|</th></tr><table>
+					<tr> <th aligh="right">|.$locale->text('Admin User') . qq| </th>
+						<td><input name="admin_username" type="text" size="32" /></td>
+					</tr>
+					<tr> <td colspan="2"> | . $locale->text('Create database user') . qq| <input name="createuser" class="checkbox" type="checkbox" value="1"></tr>
+					<tr> <th align="right"> | . $locale->text('Password') . qq| </th>
+						<td><input name="admin_password" type="password" size="32"></td>
+				</table>
 			</td>
 		</tr>
 
@@ -339,13 +342,14 @@
 sub save {
 
     $form->{callback} = "initiate.pl?action=login";
+    $form->header;
+    print "<pre>";
 
     LedgerSMB::Initiate->validateform($form,$locale);
 
     LedgerSMB::Initiate->save_database($form);
-
+    print "</pre>";
     # create user template directory and copy master files
    
-    #$form->redirect( $locale->text('User saved!') );
 }
 

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/sql/Pg-database.sql	2009-08-10 00:42:38 UTC (rev 2749)
@@ -760,6 +760,7 @@
 separate_duties|1
 entity_control|A-00001
 batch_cc|B-11111
+check_prefix|CK
 \.
 
 COMMENT ON TABLE defaults IS $$

Modified: trunk/sql/modules/LOADORDER
===================================================================
--- trunk/sql/modules/LOADORDER	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/sql/modules/LOADORDER	2009-08-10 00:42:38 UTC (rev 2749)
@@ -18,4 +18,4 @@
 Report.sql
 Voucher.sql
 admin.sql
-Reconciliaton.sql
+Reconciliation.sql

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/sql/modules/Payment.sql	2009-08-10 00:42:38 UTC (rev 2749)
@@ -1,9 +1,9 @@
 
-CREATE OR REPLACE FUNCTION payment_type__list() RETURNS SETOF payment_types AS
+CREATE OR REPLACE FUNCTION payment_type__list() RETURNS SETOF payment_type AS
 $$
-DECLARE out_row payment_types%ROWTYPE;
+DECLARE out_row payment_type%ROWTYPE;
 BEGIN
-	FOR out_row IN SELECT * FROM payment_types LOOP
+	FOR out_row IN SELECT * FROM payment_type LOOP
 		RETURN NEXT out_row;
 	END LOOP;
 END;
@@ -17,11 +17,11 @@
 	meta_number character varying(32)
 );
 
-CREATE OR REPLACE FUNCTION payment_type__get_label(in_payment_type_id int) RETURNS SETOF payment_types AS
+CREATE OR REPLACE FUNCTION payment_type__get_label(in_payment_type_id int) RETURNS SETOF payment_type AS
 $$
-DECLARE out_row payment_types%ROWTYPE;
+DECLARE out_row payment_type%ROWTYPE;
 BEGIN
-	FOR out_row IN SELECT * FROM payment_types where id=in_payment_type_id LOOP
+	FOR out_row IN SELECT * FROM payment_type where id=in_payment_type_id LOOP
 		RETURN NEXT out_row;
 	END LOOP;
 END;

Modified: trunk/sql/modules/Reconciliation.sql
===================================================================
--- trunk/sql/modules/Reconciliation.sql	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/sql/modules/Reconciliation.sql	2009-08-10 00:42:38 UTC (rev 2749)
@@ -36,7 +36,7 @@
     ledger_id int REFERENCES acc_trans(entry_id),
     voucher_id int REFERENCES voucher(id),
     overlook boolean not null default 'f',
-    cleared boolean not null default 'f',
+    cleared boolean not null default 'f'
 );
 
 CREATE TABLE cr_coa_to_account (

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2009-08-07 15:41:41 UTC (rev 2748)
+++ trunk/sql/modules/Roles.sql	2009-08-10 00:42:38 UTC (rev 2749)
@@ -1,512 +1,512 @@
 GRANT ALL ON SCHEMA public TO public; -- required for Pg 8.2
 -- Contacts
-CREATE ROLE "lsmb_<?lsmb dbname ?>__read_contact"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_read"
 WITH INHERIT NOLOGIN;
 
-GRANT SELECT ON entity TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON company TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_credit_account TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON company_to_contact TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON company_to_entity TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON company_to_location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON customertax TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON contact_class TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_class TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_note TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON entity_other_name TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON location_class TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person_to_company TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person_to_location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON person_to_location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON company_to_location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON vendortax TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON eca_to_location TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT SELECT ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__read_contact";
-GRANT EXECUTE ON FUNCTION eca__list_notes(int)  TO "lsmb_<?lsmb dbname ?>__read_contact";
+GRANT SELECT ON entity TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON company TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_craccount_edit TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON company_to_contact TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON company_to_entity TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON customertax TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON contact_class TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_class TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_note TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON entity_other_name TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON location_class TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person_to_company TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON vendortax TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON eca_to_location TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT SELECT ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__contact_read";
+GRANT EXECUTE ON FUNCTION eca__list_notes(int)  TO "lsmb_<?lsmb dbname ?>__contact_read";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (1, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (1, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (11, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (11, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (14, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (14, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (21, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (21, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (30, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (30, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (33, 'allow', 'lsmb_<?lsmb dbname ?>__read_contact');
+values (33, 'allow', 'lsmb_<?lsmb dbname ?>__contact_read');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_contact"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON entity_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON company TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON company_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON location_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON person_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON entity_credit_account TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON entity_credit_account_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON company_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON company_to_entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON SEQUENCE note_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON company_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON customertax TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT ALL ON entity_bank_account_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON entity_note TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON entity_other_name TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person_to_company TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON person_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON company_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT DELETE ON company_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON vendortax TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON eca_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT DELETE ON eca_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT DELETE ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT INSERT ON eca_note TO "lsmb_<?lsmb dbname ?>__create_contact";
+GRANT INSERT ON entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON entity_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON company TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON company_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON location_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON person_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON entity_craccount_edit TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON entity_craccount_edit_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON company_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON company_to_entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON SEQUENCE note_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON customertax TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT ALL ON entity_bank_account_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON entity_note TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON entity_other_name TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person_to_company TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT DELETE ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON vendortax TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON eca_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT DELETE ON eca_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT DELETE ON eca_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT INSERT ON eca_note TO "lsmb_<?lsmb dbname ?>__contact_create";
 
 
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (1, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (1, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (11, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (11, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (12, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (12, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (21, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (21, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (30, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (30, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
-values (31, 'allow', 'lsmb_<?lsmb dbname ?>__create_contact');
+values (31, 'allow', 'lsmb_<?lsmb dbname ?>__contact_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_contact"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_edit"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT UPDATE ON entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON company TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON entity_credit_account TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON company_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON company_to_entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON company_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON customertax TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON entity_note TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON entity_other_name TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person_to_company TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person_to_contact TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__create_contact";
-GRANT DELETE, INSERT  ON vendortax TO "lsmb_<?lsmb dbname ?>__create_contact";
+GRANT UPDATE ON entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON company TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON entity_craccount_edit TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON company_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON company_to_entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON company_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON customertax TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON entity_bank_account TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON entity_note TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON entity_class_to_entity TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON entity_other_name TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person_to_company TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person_to_contact TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT UPDATE ON person_to_location TO "lsmb_<?lsmb dbname ?>__contact_create";
+GRANT DELETE, INSERT  ON vendortax TO "lsmb_<?lsmb dbname ?>__contact_create";
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__contact_all_rights"
 WITH INHERIT NOLOGIN 
-in role "lsmb_<?lsmb dbname ?>__create_contact", 
-"lsmb_<?lsmb dbname ?>__edit_contact",
-"lsmb_<?lsmb dbname ?>__read_contact";
+in role "lsmb_<?lsmb dbname ?>__contact_create", 
+"lsmb_<?lsmb dbname ?>__contact_edit",
+"lsmb_<?lsmb dbname ?>__contact_read";
 
 -- Batches and VOuchers
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_batch"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__batch_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON batch TO "lsmb_<?lsmb dbname ?>__create_batch";
-GRANT ALL ON batch_id_seq TO "lsmb_<?lsmb dbname ?>__create_batch";
-GRANT SELECT ON batch_class TO "lsmb_<?lsmb dbname ?>__create_batch";
-GRANT INSERT ON voucher TO "lsmb_<?lsmb dbname ?>__create_batch";
-GRANT ALL ON voucher_id_seq TO "lsmb_<?lsmb dbname ?>__create_contact";
+GRANT INSERT ON batch TO "lsmb_<?lsmb dbname ?>__batch_create";
+GRANT ALL ON batch_id_seq TO "lsmb_<?lsmb dbname ?>__batch_create";
+GRANT SELECT ON batch_class TO "lsmb_<?lsmb dbname ?>__batch_create";
+GRANT INSERT ON voucher TO "lsmb_<?lsmb dbname ?>__batch_create";
+GRANT ALL ON voucher_id_seq TO "lsmb_<?lsmb dbname ?>__contact_create";
 
 -- TODO add Menu ACLs
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__post_batches"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__batch_post"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON ar TO "lsmb_<?lsmb dbname ?>__post_batches";
-GRANT UPDATE ON ap TO "lsmb_<?lsmb dbname ?>__post_batches";
-GRANT UPDATE ON acc_trans TO "lsmb_<?lsmb dbname ?>__post_batches";
-GRANT UPDATE ON batch TO "lsmb_<?lsmb dbname ?>__post_batches";
-GRANT UPDATE ON gl TO "lsmb_<?lsmb dbname ?>__post_batches";
+GRANT UPDATE ON ar TO "lsmb_<?lsmb dbname ?>__batch_post";
+GRANT UPDATE ON ap TO "lsmb_<?lsmb dbname ?>__batch_post";
+GRANT UPDATE ON acc_trans TO "lsmb_<?lsmb dbname ?>__batch_post";
+GRANT UPDATE ON batch TO "lsmb_<?lsmb dbname ?>__batch_post";
+GRANT UPDATE ON gl TO "lsmb_<?lsmb dbname ?>__batch_post";
 
 -- TODO add Menu ACLs
 
 -- AR
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ar_transaction"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__create_ar_transaction";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_ar_transaction";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_ar_transaction";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_transaction";
+GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__ar_transaction_create";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__ar_transaction_create";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ar_transaction_create";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ar_transaction_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (1, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
+values (1, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (2, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
+values (2, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (194, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
+values (194, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_create');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_batch";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__batch_create";
 
-GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher";
+GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher";
 
 -- TODO add Menu ACLs
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ar_invoice"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_invoice_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_ar_transaction";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__ar_transaction_create";
 
-GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__create_ar_invoice";
-GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_invoice";
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__create_ar_invoice";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_invoice";
+GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__ar_invoice_create";
+GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__ar_invoice_create";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__ar_invoice_create";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ar_invoice_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (3, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_invoice');
+values (3, 'allow', 'lsmb_<?lsmb dbname ?>__ar_invoice_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (195, 'allow', 'lsmb_<?lsmb dbname ?>__create_ar_transaction');
+values (195, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_batch",
-"lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__batch_create",
+"lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher";
 
-GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher";
-GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher";
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher";
+GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher";
+GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher";
 
 -- TODO add Menu ACLs
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_ar_transactions"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON ar TO "lsmb_<?lsmb dbname ?>__list_ar_transactions";
-GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__list_ar_transactions";
-GRANT SELECT ON invoice TO "lsmb_<?lsmb dbname ?>__list_ar_transactions";
-GRANT SELECT ON inventory TO "lsmb_<?lsmb dbname ?>__list_ar_transactions";
+GRANT SELECT ON ar TO "lsmb_<?lsmb dbname ?>__ar_transaction_list";
+GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ar_transaction_list";
+GRANT SELECT ON invoice TO "lsmb_<?lsmb dbname ?>__ar_transaction_list";
+GRANT SELECT ON inventory TO "lsmb_<?lsmb dbname ?>__ar_transaction_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (1, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (1, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (4, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (4, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (5, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (5, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (6, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (6, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (7, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (7, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (9, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (9, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (10, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (10, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (11, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (11, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (13, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (13, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (15, 'allow', 'lsmb_<?lsmb dbname ?>__list_ar_transactions');
+values (15, 'allow', 'lsmb_<?lsmb dbname ?>__ar_transaction_list');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_all_vouchers"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_voucher_all"
 WITH INHERIT NOLOGIN 
-IN ROLE "lsmb_<?lsmb dbname ?>__create_ar_transaction_voucher",
-"lsmb_<?lsmb dbname ?>__create_ar_invoice_voucher";
+IN ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_create_voucher",
+"lsmb_<?lsmb dbname ?>__ar_invoice_create_voucher";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_all_transactions"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_all"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_ar_transaction",
-"lsmb_<?lsmb dbname ?>__create_ar_invoice",
-"lsmb_<?lsmb dbname ?>__list_ar_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_create",
+"lsmb_<?lsmb dbname ?>__ar_invoice_create",
+"lsmb_<?lsmb dbname ?>__ar_transaction_list";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_sales_order"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__sales_order_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__create_sales_order";
-GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__create_sales_order";
-GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__create_sales_order";
-GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__create_sales_order";
+GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__sales_order_create";
+GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__sales_order_create";
+GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__sales_order_create";
+GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__sales_order_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_order');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__sales_order_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (51, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_order');
+values (51, 'allow', 'lsmb_<?lsmb dbname ?>__sales_order_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_sales_quotation"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__sales_quotation_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__create_sales_quotation";
-GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__create_sales_quotation";
-GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__create_sales_quotation";
-GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__create_sales_quotation";
+GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__sales_quotation_create";
+GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__sales_quotation_create";
+GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__sales_quotation_create";
+GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__sales_quotation_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (67, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_quotation');
+values (67, 'allow', 'lsmb_<?lsmb dbname ?>__sales_quotation_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (68, 'allow', 'lsmb_<?lsmb dbname ?>__create_sales_quotation');
+values (68, 'allow', 'lsmb_<?lsmb dbname ?>__sales_quotation_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_sales_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__sales_order_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__list_sales_orders";
-GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__list_sales_orders";
+GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__sales_order_list";
+GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__sales_order_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__sales_order_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (53, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
+values (53, 'allow', 'lsmb_<?lsmb dbname ?>__sales_order_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (54, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_orders');
+values (54, 'allow', 'lsmb_<?lsmb dbname ?>__sales_order_list');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_sales_quotations"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__sales_quotation_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__list_sales_quotations";
-GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__list_sales_quotations";
+GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__sales_quotation_list";
+GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__sales_quotation_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (67, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
+values (67, 'allow', 'lsmb_<?lsmb dbname ?>__sales_quotation_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (70, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
+values (70, 'allow', 'lsmb_<?lsmb dbname ?>__sales_quotation_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (71, 'allow', 'lsmb_<?lsmb dbname ?>__list_sales_quotations');
+values (71, 'allow', 'lsmb_<?lsmb dbname ?>__sales_quotation_list');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_ar"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ar_all"
 WITH INHERIT NOLOGIN 
-IN ROLE "lsmb_<?lsmb dbname ?>__ar_all_vouchers",
-"lsmb_<?lsmb dbname ?>__ar_all_transactions",
-"lsmb_<?lsmb dbname ?>__create_sales_order",
-"lsmb_<?lsmb dbname ?>__create_sales_quotation",
-"lsmb_<?lsmb dbname ?>__list_sales_orders",
-"lsmb_<?lsmb dbname ?>__list_sales_quotations";
+IN ROLE "lsmb_<?lsmb dbname ?>__ar_voucher_all",
+"lsmb_<?lsmb dbname ?>__ar_transaction_all",
+"lsmb_<?lsmb dbname ?>__sales_order_create",
+"lsmb_<?lsmb dbname ?>__sales_quotation_create",
+"lsmb_<?lsmb dbname ?>__sales_order_list",
+"lsmb_<?lsmb dbname ?>__sales_quotation_list";
 
 -- AP
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ap_transaction"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON ap TO "lsmb_<?lsmb dbname ?>__create_ap_transaction";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_ap_transaction";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_ap_transaction";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_transaction";
+GRANT INSERT ON ap TO "lsmb_<?lsmb dbname ?>__ap_transaction_create";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__ap_transaction_create";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ap_transaction_create";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ap_transaction_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (21, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
+values (21, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (22, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
+values (22, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (196, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
+values (196, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_create');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_batch";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__batch_create";
 
-GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher";
+GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher";
 
 -- TODO add Menu ACLs
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ap_invoice"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_invoice_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_ap_transaction";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__ap_transaction_create";
 
-GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__create_ap_invoice";
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__create_ap_invoice";
-GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_invoice";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_invoice";
+GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__ap_invoice_create";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__ap_invoice_create";
+GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__ap_invoice_create";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ap_invoice_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (23, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_invoice');
+values (23, 'allow', 'lsmb_<?lsmb dbname ?>__ap_invoice_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (197, 'allow', 'lsmb_<?lsmb dbname ?>__create_ap_transaction');
+values (197, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact",
-"lsmb_<?lsmb dbname ?>__create_batch";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read",
+"lsmb_<?lsmb dbname ?>__batch_create";
 
-GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher";
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher";
-GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher";
+GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher";
+GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher";
 
 -- TODO add Menu ACLs
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_ap_transactions"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON ap TO "lsmb_<?lsmb dbname ?>__list_ap_transactions";
-GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__list_ap_transactions";
-GRANT SELECT ON invoice TO "lsmb_<?lsmb dbname ?>__list_ap_transactions";
-GRANT SELECT ON inventory TO "lsmb_<?lsmb dbname ?>__list_ap_transactions";
+GRANT SELECT ON ap TO "lsmb_<?lsmb dbname ?>__ap_transaction_list";
+GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__ap_transaction_list";
+GRANT SELECT ON invoice TO "lsmb_<?lsmb dbname ?>__ap_transaction_list";
+GRANT SELECT ON inventory TO "lsmb_<?lsmb dbname ?>__ap_transaction_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (21, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (21, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (24, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (24, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (25, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (25, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (26, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (26, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (27, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (27, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (28, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (28, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (29, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (29, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (30, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (30, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (32, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (32, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (34, 'allow', 'lsmb_<?lsmb dbname ?>__list_ap_transactions');
+values (34, 'allow', 'lsmb_<?lsmb dbname ?>__ap_transaction_list');
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_all_vouchers"
 WITH INHERIT NOLOGIN 
-IN ROLE "lsmb_<?lsmb dbname ?>__create_ap_transaction_voucher",
-"lsmb_<?lsmb dbname ?>__create_ap_invoice_voucher";
+IN ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_create_voucher",
+"lsmb_<?lsmb dbname ?>__ap_invoice_create_voucher";
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_all_transactions"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_ap_transaction",
-"lsmb_<?lsmb dbname ?>__create_ap_invoice",
-"lsmb_<?lsmb dbname ?>__list_ap_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_create",
+"lsmb_<?lsmb dbname ?>__ap_invoice_create",
+"lsmb_<?lsmb dbname ?>__ap_transaction_list";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_purchase_order"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__purchase_order_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__create_purchase_order";
-GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__create_purchase_order";
-GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__create_purchase_order";
-GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__create_purchase_order";
+GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__purchase_order_create";
+GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__purchase_order_create";
+GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__purchase_order_create";
+GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__purchase_order_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_order');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__purchase_order_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (52, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_order');
+values (52, 'allow', 'lsmb_<?lsmb dbname ?>__purchase_order_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_purchase_rfq"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__rfq_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__create_purchase_rfq";
-GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__create_purchase_rfq";
-GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__create_purchase_rfq";
-GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__create_purchase_rfq";
+GRANT INSERT ON oe TO "lsmb_<?lsmb dbname ?>__rfq_create";
+GRANT INSERT ON orderitems TO "lsmb_<?lsmb dbname ?>__rfq_create";
+GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__rfq_create";
+GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__rfq_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (67, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_rfq');
+values (67, 'allow', 'lsmb_<?lsmb dbname ?>__rfq_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (69, 'allow', 'lsmb_<?lsmb dbname ?>__create_purchase_rfq');
+values (69, 'allow', 'lsmb_<?lsmb dbname ?>__rfq_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_purchase_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__purchase_order_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__list_purchase_orders";
-GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__list_purchase_orders";
+GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__purchase_order_list";
+GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__purchase_order_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__purchase_order_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (53, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
+values (53, 'allow', 'lsmb_<?lsmb dbname ?>__purchase_order_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (55, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_orders');
+values (55, 'allow', 'lsmb_<?lsmb dbname ?>__purchase_order_list');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_purchase_rfqs"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__rfq_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__list_purchase_rfqs";
-GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__list_purchase_rfqs";
+GRANT SELECT ON oe TO "lsmb_<?lsmb dbname ?>__rfq_list";
+GRANT SELECT ON orderitems TO "lsmb_<?lsmb dbname ?>__rfq_list";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (67, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
+values (67, 'allow', 'lsmb_<?lsmb dbname ?>__rfq_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (70, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
+values (70, 'allow', 'lsmb_<?lsmb dbname ?>__rfq_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (72, 'allow', 'lsmb_<?lsmb dbname ?>__list_purchase_rfqs');
+values (72, 'allow', 'lsmb_<?lsmb dbname ?>__rfq_list');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_ap"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__ap_all"
 WITH INHERIT NOLOGIN 
 IN ROLE "lsmb_<?lsmb dbname ?>__ap_all_vouchers",
 "lsmb_<?lsmb dbname ?>__ap_all_transactions",
-"lsmb_<?lsmb dbname ?>__create_purchase_order",
-"lsmb_<?lsmb dbname ?>__create_purchase_rfq",
-"lsmb_<?lsmb dbname ?>__list_purchase_orders",
-"lsmb_<?lsmb dbname ?>__list_purchase_rfqs";
+"lsmb_<?lsmb dbname ?>__purchase_order_create",
+"lsmb_<?lsmb dbname ?>__rfq_create",
+"lsmb_<?lsmb dbname ?>__purchase_order_list",
+"lsmb_<?lsmb dbname ?>__rfq_list";
 
 -- POS
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_pos_invoice"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__pos_enter"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_pos_invoice";
+GRANT INSERT ON invoice TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT INSERT ON ar TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT ALL ON invoice_id_seq TO "lsmb_<?lsmb dbname ?>__pos_enter";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__pos_enter";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (16, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
+values (16, 'allow', 'lsmb_<?lsmb dbname ?>__pos_enter');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (17, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
+values (17, 'allow', 'lsmb_<?lsmb dbname ?>__pos_enter');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (18, 'allow', 'lsmb_<?lsmb dbname ?>__create_pos_invoice');
+values (18, 'allow', 'lsmb_<?lsmb dbname ?>__pos_enter');
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__close_till"
@@ -537,131 +537,131 @@
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__pos_cashier"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_pos_invoice",
+IN ROLE "lsmb_<?lsmb dbname ?>__pos_enter",
 "lsmb_<?lsmb dbname ?>__close_till";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_pos"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__pos_all"
 WITH INHERIT NOLOGIN
 IN ROLE "lsmb_<?lsmb dbname ?>__pos_cashier",
 "lsmb_<?lsmb dbname ?>__list_all_open";
 
 -- CASH
-CREATE ROLE "lsmb_<?lsmb dbname ?>__reconcile"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__reconciliation_enter"
 WITH INHERIT NOLOGIN;
 
--- GRANT INSERT ON pending_reports TO "lsmb_<?lsmb dbname ?>__reconcile";
--- GRANT INSERT on report_corrections TO "lsmb_<?lsmb dbname ?>__reconcile";
-GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__reconcile";
--- GRANT ALL ON pending_reports_id_seq TO "lsmb_<?lsmb dbname ?>__reconcile";
--- GRANT ALL ON report_corrections_id_seq TO "lsmb_<?lsmb dbname ?>__reconcile";
+-- GRANT INSERT ON pending_reports TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+-- GRANT INSERT on report_corrections TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+-- GRANT ALL ON pending_reports_id_seq TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+-- GRANT ALL ON report_corrections_id_seq TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
+values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconciliation_enter');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (45, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
+values (45, 'allow', 'lsmb_<?lsmb dbname ?>_reconciliation_enter');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__approve_reconciliation"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__reconciliation_approve"
 WITH INHERIT NOLOGIN;
 
--- GRANT UPDATE ON pending_reports TO "lsmb_<?lsmb dbname ?>__reconcile";
-GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__reconcile";
+-- GRANT UPDATE ON pending_reports TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+GRANT SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
+values (35, 'allow', 'lsmb_<?lsmb dbname ?>_reconciliation_enter');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (41, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
+values (41, 'allow', 'lsmb_<?lsmb dbname ?>_reconciliation_enter');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (44, 'allow', 'lsmb_<?lsmb dbname ?>_reconcile');
+values (44, 'allow', 'lsmb_<?lsmb dbname ?>_reconciliation_enter');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_reconcile"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__all_reconciliation_enter"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__reconcile",
-"lsmb_<?lsmb dbname ?>__approve_reconciliation";
+IN ROLE "lsmb_<?lsmb dbname ?>__reconciliation_enter",
+"lsmb_<?lsmb dbname ?>__reconciliation_approve";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__process_payment"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__payment_process"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_ap_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__ap_transaction_list";
 
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__process_payment";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__process_payment";
-GRANT UPDATE ON ap TO "lsmb_<?lsmb dbname ?>__process_payment";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__payment_process";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__payment_process";
+GRANT UPDATE ON ap TO "lsmb_<?lsmb dbname ?>__payment_process";
 
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (35, 'allow', 'lsmb_<?lsmb dbname ?>__process_payment');
+values (35, 'allow', 'lsmb_<?lsmb dbname ?>__payment_process');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (38, 'allow', 'lsmb_<?lsmb dbname ?>__process_payment');
+values (38, 'allow', 'lsmb_<?lsmb dbname ?>__payment_process');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__process_receipt"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__receipt_process"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_ar_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_list";
 
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__process_receipt";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__process_receipt";
-GRANT UPDATE ON ar TO "lsmb_<?lsmb dbname ?>__process_receipt";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__receipt_process";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__receipt_process";
+GRANT UPDATE ON ar TO "lsmb_<?lsmb dbname ?>__receipt_process";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (35, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
+values (35, 'allow', 'lsmb_<?lsmb dbname ?>__receipt_process');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (36, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
+values (36, 'allow', 'lsmb_<?lsmb dbname ?>__receipt_process');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (47, 'allow', 'lsmb_<?lsmb dbname ?>__process_receipt');
+values (47, 'allow', 'lsmb_<?lsmb dbname ?>__receipt_process');
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__cash_all"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__all_reconcile",
-"lsmb_<?lsmb dbname ?>__process_payment",
-"lsmb_<?lsmb dbname ?>__process_receipt";
+IN ROLE "lsmb_<?lsmb dbname ?>__all_reconciliation_enter",
+"lsmb_<?lsmb dbname ?>__payment_process",
+"lsmb_<?lsmb dbname ?>__receipt_process";
 
 -- Inventory Control
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_part"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__part_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON parts TO "lsmb_<?lsmb dbname ?>__create_part";
-GRANT ALL ON parts_id_seq TO "lsmb_<?lsmb dbname ?>__create_part";
-GRANT INSERT ON partstax TO "lsmb_<?lsmb dbname ?>__create_part";
+GRANT INSERT ON parts TO "lsmb_<?lsmb dbname ?>__part_create";
+GRANT ALL ON parts_id_seq TO "lsmb_<?lsmb dbname ?>__part_create";
+GRANT INSERT ON partstax TO "lsmb_<?lsmb dbname ?>__part_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (77, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (77, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (78, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (78, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (79, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (79, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (80, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (80, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (81, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (81, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (82, 'allow', 'lsmb_<?lsmb dbname ?>__create_part');
+values (82, 'allow', 'lsmb_<?lsmb dbname ?>__part_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_part"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__part_edit"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON parts TO "lsmb_<?lsmb dbname ?>__edit_part";
+GRANT UPDATE ON parts TO "lsmb_<?lsmb dbname ?>__part_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (77, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (77, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (85, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (85, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (86, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (86, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (87, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (87, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (88, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (88, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (89, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (89, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (90, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (90, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (91, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (91, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (93, 'allow', 'lsmb_<?lsmb dbname ?>__edit_part');
+values (93, 'allow', 'lsmb_<?lsmb dbname ?>__part_edit');
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__inventory_reports"
@@ -683,730 +683,730 @@
 values (94, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_reports');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_pricegroup"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__pricegroup_create"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON pricegroup TO "lsmb_<?lsmb dbname ?>__create_pricegroup";
-GRANT ALL ON pricegroup_id_seq TO "lsmb_<?lsmb dbname ?>__create_pricegroup";
-GRANT UPDATE ON entity_credit_account TO "lsmb_<?lsmb dbname ?>__create_pricegroup";
+GRANT INSERT ON pricegroup TO "lsmb_<?lsmb dbname ?>__pricegroup_create";
+GRANT ALL ON pricegroup_id_seq TO "lsmb_<?lsmb dbname ?>__pricegroup_create";
+GRANT UPDATE ON entity_craccount_edit TO "lsmb_<?lsmb dbname ?>__pricegroup_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (77, 'allow', 'lsmb_<?lsmb dbname ?>__create_pricegroup');
+values (77, 'allow', 'lsmb_<?lsmb dbname ?>__pricegroup_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (83, 'allow', 'lsmb_<?lsmb dbname ?>__create_pricegroup');
+values (83, 'allow', 'lsmb_<?lsmb dbname ?>__pricegroup_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_pricegroup"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__pricegroup_edit"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT UPDATE ON pricegroup TO "lsmb_<?lsmb dbname ?>__edit_pricegroup";
-GRANT UPDATE ON entity_credit_account TO "lsmb_<?lsmb dbname ?>__edit_pricegroup";
+GRANT UPDATE ON pricegroup TO "lsmb_<?lsmb dbname ?>__pricegroup_edit";
+GRANT UPDATE ON entity_craccount_edit TO "lsmb_<?lsmb dbname ?>__pricegroup_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (77, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
+values (77, 'allow', 'lsmb_<?lsmb dbname ?>__pricegroup_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (85, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
+values (85, 'allow', 'lsmb_<?lsmb dbname ?>__pricegroup_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (92, 'allow', 'lsmb_<?lsmb dbname ?>__edit_pricegroup');
+values (92, 'allow', 'lsmb_<?lsmb dbname ?>__pricegroup_edit');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__stock_assembly"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__assembly_stock"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON parts TO "lsmb_<?lsmb dbname ?>__stock_assembly";
+GRANT UPDATE ON parts TO "lsmb_<?lsmb dbname ?>__assembly_stock";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (77, 'allow', 'lsmb_<?lsmb dbname ?>__stock_assembly');
+values (77, 'allow', 'lsmb_<?lsmb dbname ?>__assembly_stock');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (84, 'allow', 'lsmb_<?lsmb dbname ?>__stock_assembly');
+values (84, 'allow', 'lsmb_<?lsmb dbname ?>__assembly_stock');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__ship_inventory"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__inventory_ship"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_sales_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__sales_order_list";
 
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__ship_inventory";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__ship_inventory";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__inventory_ship";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__inventory_ship";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (63, 'allow', 'lsmb_<?lsmb dbname ?>__ship_inventory');
+values (63, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_ship');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (64, 'allow', 'lsmb_<?lsmb dbname ?>__ship_inventory');
+values (64, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_ship');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__receive_inventory"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__inventory_receive"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_purchase_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__purchase_order_list";
 
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__receive_inventory";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__receive_inventory";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__inventory_receive";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__inventory_receive";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (63, 'allow', 'lsmb_<?lsmb dbname ?>__receive_inventory');
+values (63, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_receive');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (65, 'allow', 'lsmb_<?lsmb dbname ?>__receive_inventory');
+values (65, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_receive');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__transfer_inventory"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__inventory_transfer"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__transfer_inventory";
-GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__transfer_inventory";
+GRANT INSERT ON inventory TO "lsmb_<?lsmb dbname ?>__inventory_transfer";
+GRANT ALL ON inventory_entry_id_seq TO "lsmb_<?lsmb dbname ?>__inventory_transfer";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (63, 'allow', 'lsmb_<?lsmb dbname ?>__transfer_inventory');
+values (63, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_transfer');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (66, 'allow', 'lsmb_<?lsmb dbname ?>__transfer_inventory');
+values (66, 'allow', 'lsmb_<?lsmb dbname ?>__inventory_transfer');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_warehouse"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__warehouse_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON warehouse TO "lsmb_<?lsmb dbname ?>__create_warehouse";
-GRANT ALL ON warehouse_id_seq TO "lsmb_<?lsmb dbname ?>__create_warehouse";
+GRANT INSERT ON warehouse TO "lsmb_<?lsmb dbname ?>__warehouse_create";
+GRANT ALL ON warehouse_id_seq TO "lsmb_<?lsmb dbname ?>__warehouse_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (141, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
+values (141, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (142, 'allow', 'lsmb_<?lsmb dbname ?>__create_warehouse');
+values (142, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_warehouse"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__warehouse_edit"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON warehouse TO "lsmb_<?lsmb dbname ?>__edit_warehouse";
+GRANT UPDATE ON warehouse TO "lsmb_<?lsmb dbname ?>__warehouse_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (141, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
+values (141, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (143, 'allow', 'lsmb_<?lsmb dbname ?>__edit_warehouse');
+values (143, 'allow', 'lsmb_<?lsmb dbname ?>__warehouse_edit');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_inventory"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__inventory_all"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_part",
+IN ROLE "lsmb_<?lsmb dbname ?>__part_create",
 "lsmb_<?lsmb dbname ?>__inventory_reports",
-"lsmb_<?lsmb dbname ?>__stock_assembly",
-"lsmb_<?lsmb dbname ?>__ship_inventory",
-"lsmb_<?lsmb dbname ?>__receive_inventory",
-"lsmb_<?lsmb dbname ?>__transfer_inventory",
-"lsmb_<?lsmb dbname ?>__edit_warehouse",
-"lsmb_<?lsmb dbname ?>__create_warehouse";
+"lsmb_<?lsmb dbname ?>__assembly_stock",
+"lsmb_<?lsmb dbname ?>__inventory_ship",
+"lsmb_<?lsmb dbname ?>__inventory_receive",
+"lsmb_<?lsmb dbname ?>__inventory_transfer",
+"lsmb_<?lsmb dbname ?>__warehouse_edit",
+"lsmb_<?lsmb dbname ?>__warehouse_create";
 
 -- GL 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_transaction"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__gl_transaction_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON gl TO "lsmb_<?lsmb dbname ?>__create_transaction";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_transaction";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_transaction";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_transaction";
+GRANT INSERT ON gl TO "lsmb_<?lsmb dbname ?>__gl_transaction_create";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__gl_transaction_create";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__gl_transaction_create";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__gl_transaction_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (73, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
+values (73, 'allow', 'lsmb_<?lsmb dbname ?>__gl_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (74, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
+values (74, 'allow', 'lsmb_<?lsmb dbname ?>__gl_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (75, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
+values (75, 'allow', 'lsmb_<?lsmb dbname ?>__gl_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (35, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
+values (35, 'allow', 'lsmb_<?lsmb dbname ?>__gl_transaction_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (40, 'allow', 'lsmb_<?lsmb dbname ?>__create_transaction');
+values (40, 'allow', 'lsmb_<?lsmb dbname ?>__gl_transaction_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_transaction_voucher"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__gl_voucher_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON gl TO "lsmb_<?lsmb dbname ?>__create_transaction_voucher";
-GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__create_transaction_voucher";
-GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__create_transaction_voucher";
-GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__create_transaction_voucher";
+GRANT INSERT ON gl TO "lsmb_<?lsmb dbname ?>__gl_voucher_create";
+GRANT INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__gl_voucher_create";
+GRANT ALL ON id TO "lsmb_<?lsmb dbname ?>__gl_voucher_create";
+GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__gl_voucher_create";
 
 -- TODO Add menu permissions
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_transactions"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__gl_reports"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_ar_transactions",
-"lsmb_<?lsmb dbname ?>__list_ap_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__ar_transaction_list",
+"lsmb_<?lsmb dbname ?>__ap_transaction_list";
 
-GRANT SELECT ON gl TO "lsmb_<?lsmb dbname ?>__list_transactions";
+GRANT SELECT ON gl TO "lsmb_<?lsmb dbname ?>__gl_reports";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (73, 'allow', 'lsmb_<?lsmb dbname ?>__list_transactions');
+values (73, 'allow', 'lsmb_<?lsmb dbname ?>__gl_reports');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (76, 'allow', 'lsmb_<?lsmb dbname ?>__list_transactions');
+values (76, 'allow', 'lsmb_<?lsmb dbname ?>__gl_reports');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__run_yearend"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__yearend_run"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT, SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__run_yearend";
+GRANT INSERT, SELECT ON acc_trans TO "lsmb_<?lsmb dbname ?>__yearend_run";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__run_yearend');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__yearend_run');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (132, 'allow', 'lsmb_<?lsmb dbname ?>__run_yearend');
+values (132, 'allow', 'lsmb_<?lsmb dbname ?>__yearend_run');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_batches"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__batch_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__gl_reports";
 
-GRANT SELECT ON batch TO "lsmb_<?lsmb dbname ?>__list_batches";
-GRANT SELECT ON batch_class TO "lsmb_<?lsmb dbname ?>__list_batches";
-GRANT SELECT ON voucher TO "lsmb_<?lsmb dbname ?>__list_batches";
+GRANT SELECT ON batch TO "lsmb_<?lsmb dbname ?>__batch_list";
+GRANT SELECT ON batch_class TO "lsmb_<?lsmb dbname ?>__batch_list";
+GRANT SELECT ON voucher TO "lsmb_<?lsmb dbname ?>__batch_list";
 
 -- TODO:  Add menu items
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__all_gl"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_transaction",
-"lsmb_<?lsmb dbname ?>__create_transaction_voucher",
-"lsmb_<?lsmb dbname ?>__run_yearend",
-"lsmb_<?lsmb dbname ?>__list_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__gl_transaction_create",
+"lsmb_<?lsmb dbname ?>__gl_voucher_create",
+"lsmb_<?lsmb dbname ?>__yearend_run",
+"lsmb_<?lsmb dbname ?>__gl_reports";
 
 -- PROJECTS
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_project"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__project_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON project TO "lsmb_<?lsmb dbname ?>__create_project";
-GRANT ALL ON project_id_seq TO "lsmb_<?lsmb dbname ?>__create_project";
+GRANT INSERT ON project TO "lsmb_<?lsmb dbname ?>__project_create";
+GRANT ALL ON project_id_seq TO "lsmb_<?lsmb dbname ?>__project_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (98, 'allow', 'lsmb_<?lsmb dbname ?>__create_project');
+values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (99, 'allow', 'lsmb_<?lsmb dbname ?>__create_project');
+values (99, 'allow', 'lsmb_<?lsmb dbname ?>__project_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_project"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__project_edit"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON project TO "lsmb_<?lsmb dbname ?>__edit_project";
+GRANT UPDATE ON project TO "lsmb_<?lsmb dbname ?>__project_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (98, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (103, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (103, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (104, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (104, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__add_project_timecard"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__project_timecard_add"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT INSERT ON jcitems TO "lsmb_<?lsmb dbname ?>__add_project_timecard";
-GRANT ALL ON jcitems_id_seq TO "lsmb_<?lsmb dbname ?>__add_project_timecard";
+GRANT INSERT ON jcitems TO "lsmb_<?lsmb dbname ?>__project_timecard_add";
+GRANT ALL ON jcitems_id_seq TO "lsmb_<?lsmb dbname ?>__project_timecard_add";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (98, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
+values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_timecard_add');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (100, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
+values (100, 'allow', 'lsmb_<?lsmb dbname ?>__project_timecard_add');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (103, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
+values (103, 'allow', 'lsmb_<?lsmb dbname ?>__project_timecard_add');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (106, 'allow', 'lsmb_<?lsmb dbname ?>__add_project_timecard');
+values (106, 'allow', 'lsmb_<?lsmb dbname ?>__project_timecard_add');
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_project_timecards"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__project_timecard_list"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT UPDATE ON project TO "lsmb_<?lsmb dbname ?>__edit_project";
+GRANT UPDATE ON project TO "lsmb_<?lsmb dbname ?>__project_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (98, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (103, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (103, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (106, 'allow', 'lsmb_<?lsmb dbname ?>__edit_project');
+values (106, 'allow', 'lsmb_<?lsmb dbname ?>__project_edit');
 
 
 
 -- ORDER GENERATION
-CREATE ROLE "lsmb_<?lsmb dbname ?>__generate_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__orders_generate"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__read_contact";
+IN ROLE "lsmb_<?lsmb dbname ?>__contact_read";
 
-GRANT SELECT, INSERT, UPDATE ON oe TO "lsmb_<?lsmb dbname ?>__generate_orders";
-GRANT SELECT, INSERT, UPDATE ON orderitems TO "lsmb_<?lsmb dbname ?>__generate_orders";
-GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__generate_orders";
-GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__generate_orders";
+GRANT SELECT, INSERT, UPDATE ON oe TO "lsmb_<?lsmb dbname ?>__orders_generate";
+GRANT SELECT, INSERT, UPDATE ON orderitems TO "lsmb_<?lsmb dbname ?>__orders_generate";
+GRANT ALL ON oe_id_seq TO "lsmb_<?lsmb dbname ?>__orders_generate";
+GRANT ALL ON orderitems_id_seq TO "lsmb_<?lsmb dbname ?>__orders_generate";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__project_generate_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__project_order_generate"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__generate_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__orders_generate";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
+values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_order_generate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (101, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
+values (101, 'allow', 'lsmb_<?lsmb dbname ?>__project_order_generate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (102, 'allow', 'lsmb_<?lsmb dbname ?>__project_generate_orders');
+values (102, 'allow', 'lsmb_<?lsmb dbname ?>__project_order_generate');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__sales_to_purchase_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__orders_sales_to_purchase"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__generate_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__orders_generate";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_to_purchase');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (56, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
+values (56, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_to_purchase');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (57, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
+values (57, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_to_purchase');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (58, 'allow', 'lsmb_<?lsmb dbname ?>__sales_to_purchase_orders');
+values (58, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_to_purchase');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__consolidate_purchase_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__orders_purchase_consolidate"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__generate_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__orders_generate";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__orders_purchase_consolidate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (60, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
+values (60, 'allow', 'lsmb_<?lsmb dbname ?>__orders_purchase_consolidate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (62, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_purchase_orders');
+values (62, 'allow', 'lsmb_<?lsmb dbname ?>__orders_purchase_consolidate');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__consolidate_sales_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__orders_sales_consolidate"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__generate_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__orders_generate";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (50, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
+values (50, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_consolidate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (60, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
+values (60, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_consolidate');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (61, 'allow', 'lsmb_<?lsmb dbname ?>__consolidate_sales_orders');
+values (61, 'allow', 'lsmb_<?lsmb dbname ?>__orders_sales_consolidate');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__manage_orders"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__orders_manage"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__project_generate_orders",
-"lsmb_<?lsmb dbname ?>__sales_to_purchase_orders",
-"lsmb_<?lsmb dbname ?>__consolidate_purchase_orders",
-"lsmb_<?lsmb dbname ?>__consolidate_sales_orders";
+IN ROLE "lsmb_<?lsmb dbname ?>__project_order_generate",
+"lsmb_<?lsmb dbname ?>__orders_sales_to_purchase",
+"lsmb_<?lsmb dbname ?>__orders_purchase_consolidate",
+"lsmb_<?lsmb dbname ?>__orders_sales_consolidate";
 
 -- FINANCIAL REPORTS
-CREATE ROLE "lsmb_<?lsmb dbname ?>__run_financial_reports"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__financial_reports"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_transactions";
+IN ROLE "lsmb_<?lsmb dbname ?>__gl_reports";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (109, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
+values (109, 'allow', 'lsmb_<?lsmb dbname ?>__financial_reports');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (110, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
+values (110, 'allow', 'lsmb_<?lsmb dbname ?>__financial_reports');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (111, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
+values (111, 'allow', 'lsmb_<?lsmb dbname ?>__financial_reports');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (112, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
+values (112, 'allow', 'lsmb_<?lsmb dbname ?>__financial_reports');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (113, 'allow', 'lsmb_<?lsmb dbname ?>__run_financial_reports');
+values (113, 'allow', 'lsmb_<?lsmb dbname ?>__financial_reports');
 
 
 -- RECURRING TRANSACTIONS
 -- TO ADD WHEN THIS IS REDESIGNED
 
 -- BATCH PRINTING
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_print_jobs"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__print_jobs_list"
 WITH INHERIT NOLOGIN;
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (116, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (116, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (117, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (117, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (118, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (118, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (119, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (119, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (120, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (120, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (121, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (121, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (122, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (122, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (123, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (123, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (124, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (124, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (125, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (125, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (126, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (126, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (127, 'allow', 'lsmb_<?lsmb dbname ?>__list_print_jobs');
+values (127, 'allow', 'lsmb_<?lsmb dbname ?>__print_jobs_list');
 
 
 CREATE ROLE "lsmb_<?lsmb dbname ?>__print_jobs"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_print_jobs";
+IN ROLE "lsmb_<?lsmb dbname ?>__print_jobs_list";
 
 
 -- SYSTEM SETTINGS	
-CREATE ROLE "lsmb_<?lsmb dbname ?>__list_system_settings"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__system_settings_list"
 WITH INHERIT NOLOGIN;
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__system_settings_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (129, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
+values (129, 'allow', 'lsmb_<?lsmb dbname ?>__system_settings_list');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (131, 'allow', 'lsmb_<?lsmb dbname ?>__list_system_settings');
+values (131, 'allow', 'lsmb_<?lsmb dbname ?>__system_settings_list');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__change_system_settings"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__system_settings_change"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__list_system_settings";
+IN ROLE "lsmb_<?lsmb dbname ?>__system_settings_list";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__set_taxes"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__taxes_set"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT, UPDATE ON tax TO "lsmb_<?lsmb dbname ?>__set_taxes";
+GRANT INSERT, UPDATE ON tax TO "lsmb_<?lsmb dbname ?>__taxes_set";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__set_taxes');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__taxes_set');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (130, 'allow', 'lsmb_<?lsmb dbname ?>__set_taxes');
+values (130, 'allow', 'lsmb_<?lsmb dbname ?>__taxes_set');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_account"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__account_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON chart TO "lsmb_<?lsmb dbname ?>__create_account";
-GRANT ALL ON chart_id_seq TO "lsmb_<?lsmb dbname ?>__create_account";
+GRANT INSERT ON chart TO "lsmb_<?lsmb dbname ?>__account_create";
+GRANT ALL ON chart_id_seq TO "lsmb_<?lsmb dbname ?>__account_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__account_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (136, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
+values (136, 'allow', 'lsmb_<?lsmb dbname ?>__account_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (137, 'allow', 'lsmb_<?lsmb dbname ?>__create_account');
+values (137, 'allow', 'lsmb_<?lsmb dbname ?>__account_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_account"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__account_edit"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON chart TO "lsmb_<?lsmb dbname ?>__edit_account";
+GRANT UPDATE ON chart TO "lsmb_<?lsmb dbname ?>__account_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__account_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (136, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (136, 'allow', 'lsmb_<?lsmb dbname ?>__account_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (138, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (138, 'allow', 'lsmb_<?lsmb dbname ?>__account_edit');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_gifi"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__gifi_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON gifi TO "lsmb_<?lsmb dbname ?>__create_gifi";
+GRANT INSERT ON gifi TO "lsmb_<?lsmb dbname ?>__gifi_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (136, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
+values (136, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (139, 'allow', 'lsmb_<?lsmb dbname ?>__create_gifi');
+values (139, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_create');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__edit_gifi"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__gifi_edit"
 WITH INHERIT NOLOGIN;
 
-GRANT UPDATE ON gifi TO "lsmb_<?lsmb dbname ?>__edit_gifi";
+GRANT UPDATE ON gifi TO "lsmb_<?lsmb dbname ?>__gifi_edit";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (128, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (128, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (136, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (136, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_edit');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
-values (140, 'allow', 'lsmb_<?lsmb dbname ?>__edit_account');
+values (140, 'allow', 'lsmb_<?lsmb dbname ?>__gifi_edit');
 
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__all_accounts"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__account_all"
 WITH INHERIT NOLOGIN
-IN ROLE "lsmb_<?lsmb dbname ?>__create_account",
-"lsmb_<?lsmb dbname ?>__set_taxes",
-"lsmb_<?lsmb dbname ?>__edit_account",
-"lsmb_<?lsmb dbname ?>__create_gifi",
-"lsmb_<?lsmb dbname ?>__edit_gifi";
+IN ROLE "lsmb_<?lsmb dbname ?>__account_create",
+"lsmb_<?lsmb dbname ?>__taxes_set",
+"lsmb_<?lsmb dbname ?>__account_edit",
+"lsmb_<?lsmb dbname ?>__gifi_create",
+"lsmb_<?lsmb dbname ?>__gifi_edit";
 
-CREATE ROLE "lsmb_<?lsmb dbname ?>__create_department"
+CREATE ROLE "lsmb_<?lsmb dbname ?>__department_create"
 WITH INHERIT NOLOGIN;
 
-GRANT INSERT ON department TO "lsmb_<?lsmb dbname ?>__create_department";
-GRANT ALL ON department_id_seq TO "lsmb_<?lsmb dbname ?>__create_department";
+GRANT INSERT ON department TO "lsmb_<?lsmb dbname ?>__department_create";
+GRANT ALL ON department_id_seq TO "lsmb_<?lsmb dbname ?>__department_create";
 
 INSERT INTO menu_acl (node_id, acl_type, role_name)

@@ Diff output truncated at 100000 characters. @@

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.