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

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



Revision: 5764
          http://sourceforge.net/p/ledger-smb/code/5764
Author:   ehuelsmann
Date:     2013-05-11 08:16:30 +0000 (Sat, 11 May 2013)
Log Message:
-----------
Fix loading issue by moving lsmb__role() and lsmb__role_prefix().

Modified Paths:
--------------
    trunk/sql/modules/Settings.sql
    trunk/sql/modules/Util.sql

Modified: trunk/sql/modules/Settings.sql
===================================================================
--- trunk/sql/modules/Settings.sql	2013-05-11 08:03:31 UTC (rev 5763)
+++ trunk/sql/modules/Settings.sql	2013-05-11 08:16:30 UTC (rev 5764)
@@ -118,4 +118,25 @@
 
 ALTER TABLE entity ALTER control_code SET default setting_increment('entity_control');
 
+
+CREATE OR REPLACE FUNCTION lsmb__role_prefix() RETURNS text
+LANGUAGE SQL AS
+$$ select coalesce((setting_get('role_prefix')).value,
+                   'lsmb_' || current_database() || '__'); $$;
+
+COMMENT ON FUNCTION lsmb__role_prefix() IS
+$$ Returns the prefix text to be used for roles. E.g.  'lsmb__mycompany_' $$;
+
+
+CREATE OR REPLACE FUNCTION lsmb__role(global_role text) RETURNS text
+LANGUAGE SQL AS
+$$ select lsmb__role_prefix() || $1; $$;
+
+COMMENT ON FUNCTION lsmb__role(global_role text) IS
+$$ Prepends the role prefix to a role name.
+
+E.g. 'contact_edit' is converted to 'lsmb_mycompany__contact_edit'
+$$;
+
+
 COMMIT;

Modified: trunk/sql/modules/Util.sql
===================================================================
--- trunk/sql/modules/Util.sql	2013-05-11 08:03:31 UTC (rev 5763)
+++ trunk/sql/modules/Util.sql	2013-05-11 08:16:30 UTC (rev 5764)
@@ -121,13 +121,4 @@
 LANGUAGE SQL AS
 $$ SELECT max(transdate) FROM acc_trans; $$;
 
-CREATE OR REPLACE FUNCTION lsmb__role_prefix() RETURNS text
-LANGUAGE SQL AS
-$$ select coalesce((setting_get('role_prefix')).value,
-                   'lsmb_' || current_database() || '__'); $$;
-
-CREATE OR REPLACE FUNCTION lsmb__role(global_role text) RETURNS text
-LANGUAGE SQL AS
-$$ select lsmb__role_prefix() || $1; $$;
-
 COMMIT;

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