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

SF.net SVN: ledger-smb:[3373] trunk/sql



Revision: 3373
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3373&view=rev
Author:   einhverfr
Date:     2011-06-28 13:50:02 +0000 (Tue, 28 Jun 2011)

Log Message:
-----------
Correcting System.sql test failures

Modified Paths:
--------------
    trunk/sql/modules/Person.sql
    trunk/sql/modules/Roles.sql

Added Paths:
-----------
    trunk/sql/upgrade/3372-drop-location-delete.sql

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2011-06-28 13:23:32 UTC (rev 3372)
+++ trunk/sql/modules/Person.sql	2011-06-28 13:50:02 UTC (rev 3373)
@@ -251,32 +251,6 @@
     END;
 $$ language 'plpgsql';
 
-CREATE OR REPLACE FUNCTION person__delete_location (
-    in_entity_id INT, in_location_id INT
-) returns int AS $$
-
-DECLARE
-    v_loc location;
-    
-BEGIN
-    
-    select loc.* into v_loc FROM location loc
-    JOIN person_to_location ptl ON loc.id = ptl.location_id
-    JOIN person p ON p.id = ptl.person_id
-    WHERE p.entity_id = in_entity_id 
-    AND loc.id = in_location_id;
-    
-    IF NOT FOUND THEN
-       RAISE EXCEPTION 'Cannot find records to delete for entity % and location %', in_entity_id, in_location_id;
-    ELSE
-        DELETE FROM people_to_location WHERE location_id = in_location_id;
-        DELETE FROM location WHERE location_id = in_location_id;
-    END IF;
-
-END;
-
-$$ language plpgsql;
-
 CREATE OR REPLACE FUNCTION person__all_locations (
     in_entity_id int
 ) returns setof location AS $$

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-06-28 13:23:32 UTC (rev 3372)
+++ trunk/sql/modules/Roles.sql	2011-06-28 13:50:02 UTC (rev 3373)
@@ -32,6 +32,7 @@
 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 ?>__contact_read');
 INSERT INTO menu_acl (node_id, acl_type, role_name) 
@@ -579,6 +580,9 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__reconciliation_enter"
 WITH INHERIT NOLOGIN;
 
+GRANT SELECT ON recon_payee 
+TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
+
  GRANT INSERT ON cr_report, cr_report_line 
 TO "lsmb_<?lsmb dbname ?>__reconciliation_enter";
 GRANT DELETE ON cr_report_line
@@ -597,6 +601,9 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__reconciliation_approve"
 WITH INHERIT NOLOGIN;
 
+GRANT SELECT ON recon_payee 
+TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
+
 GRANT UPDATE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
 GRANT SELECT ON acc_trans, account_checkpoint TO 
 "lsmb_<?lsmb dbname ?>__reconciliation_approve";
@@ -1512,6 +1519,9 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__part_translation_create"
 WITH INHERIT NOLOGIN;
 
+GRANT ALL ON parts_translation 
+TO "lsmb_<?lsmb dbname ?>__part_translation_create";
+
 INSERT INTO menu_acl (node_id, acl_type, role_name)
 values (77, 'allow', 'lsmb_<?lsmb dbname ?>__part_translation_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
@@ -1525,6 +1535,9 @@
 CREATE ROLE "lsmb_<?lsmb dbname ?>__project_translation_create"
 WITH INHERIT NOLOGIN;
 
+GRANT ALL ON project_translation 
+TO "lsmb_<?lsmb dbname ?>__part_translation_create";
+
 INSERT INTO menu_acl (node_id, acl_type, role_name)
 values (98, 'allow', 'lsmb_<?lsmb dbname ?>__project_translation_create');
 INSERT INTO menu_acl (node_id, acl_type, role_name)
@@ -1579,6 +1592,7 @@
 GRANT SELECT ON warehouse TO public;
 GRANT select ON account_link_description TO PUBLIC;
 GRANT select ON sic TO public;
+GRANT SELECT ON parts_translation,  project_translation TO public;
 
 GRANT EXECUTE ON FUNCTION user__get_all_users() TO public;
 

Added: trunk/sql/upgrade/3372-drop-location-delete.sql
===================================================================
--- trunk/sql/upgrade/3372-drop-location-delete.sql	                        (rev 0)
+++ trunk/sql/upgrade/3372-drop-location-delete.sql	2011-06-28 13:50:02 UTC (rev 3373)
@@ -0,0 +1 @@
+DROP FUNCTION person__delete_location (in_entity_id INT, in_location_id INT);


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