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

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



Revision: 1683
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1683&view=rev
Author:   einhverfr
Date:     2007-10-01 15:10:17 -0700 (Mon, 01 Oct 2007)

Log Message:
-----------
Adding role listing function

Modified Paths:
--------------
    trunk/CONTRIBUTORS
    trunk/sql/modules/admin.sql

Modified: trunk/CONTRIBUTORS
===================================================================
--- trunk/CONTRIBUTORS	2007-09-30 23:22:55 UTC (rev 1682)
+++ trunk/CONTRIBUTORS	2007-10-01 22:10:17 UTC (rev 1683)
@@ -12,11 +12,13 @@
 current coding standards, and other contributions.
 
 Joshua Drake <jd @ commandprompt . com>
-Contributed database fixes.
+Contributed database fixes, the contact/company/entity schema, and other 
+db-centric changes.
 
 Seneca Cunningham <tentra @ gmail.com> 
 Contributed code fixes and support for advanced tax rules.  She has also 
-re-engineered the localization framework.
+re-engineered the localization framework.  She has also provided support for 
+Excel, ODS, and other formats for reports.
 
 Jason Rodrigues <jasonjayr+ledgersmb @ gmail.com> provided the logic to force 
 the password change in the admin.pl.  He maintains the Gentoo Ebuilds packages.

Modified: trunk/sql/modules/admin.sql
===================================================================
--- trunk/sql/modules/admin.sql	2007-09-30 23:22:55 UTC (rev 1682)
+++ trunk/sql/modules/admin.sql	2007-10-01 22:10:17 UTC (rev 1683)
@@ -402,4 +402,24 @@
     remove a login-capable user.
 $$;
 
+CREATE OR REPLACE FUNCTION admin_list_roles(in_username text)
+RETURNS SETOF text AS
+$$
+DECLARE out_rolename RECORD;
+BEGIN
+	FOR out_rolename IN 
+		SELECT rolname FROM pg_authid 
+		WHERE oid IN (SELECT id FROM connectby(
+			'(SELECT m.member, m.roleid, r.oid FROM pg_authid r 
+			LEFT JOIN pg_auth_members m ON (r.oid = m.roleid)) a',
+			'oid', 'member', 'oid', '320461', '0', ','
+			) c(id integer, parent integer, "level" integer, 
+				path text, list_order integer)
+			)
+	LOOP
+		RETURN NEXT out_rolename.rolname;
+	END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
+
 -- TODO:  Add admin user


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