[open-ils-commits] r7559 - trunk/Evergreen/xul/staff_client/server/patron

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jul 17 12:27:53 EDT 2007


Author: erickson
Date: 2007-07-17 12:22:20 -0400 (Tue, 17 Jul 2007)
New Revision: 7559

Modified:
   trunk/Evergreen/xul/staff_client/server/patron/ue.js
   trunk/Evergreen/xul/staff_client/server/patron/ue_config.js
Log:
forward porting : svn merge -r7557:7558 svn://svn.open-ils.org/ILS/branches/rel_1_2/ .

Modified: trunk/Evergreen/xul/staff_client/server/patron/ue.js
===================================================================
--- trunk/Evergreen/xul/staff_client/server/patron/ue.js	2007-07-17 16:18:26 UTC (rev 7558)
+++ trunk/Evergreen/xul/staff_client/server/patron/ue.js	2007-07-17 16:22:20 UTC (rev 7559)
@@ -105,9 +105,29 @@
 /* ------------------------------------------------------------------------------ */
 
 
+/*  
+ * adds all of the group.application_perm's to the list 
+ * provided by descending through the group tree 
+ */
+function buildAppPermList(list, group) {
+	if(!group) return;
+	if(group.application_perm() ) 
+        list.push(group.application_perm());
+    for(i in group.children()) {
+        buildAppPermList(list, group.children()[i]);
+    }
+}
 
-/* fetches necessary and builds the UI */
+/* fetches necessary objects and builds the UI */
 function uEditBuild() {
+
+    myPerms = ['BAR_PATRON'];
+
+    /*  grab the groups before we check perms so we know what
+        application_perms to check */
+    var groups = uEditFetchGroups();
+    buildAppPermList(myPerms, groups);
+
 	fetchHighestPermOrgs( SESSION, USER.id(), myPerms );
 
 	uEditBuildLibSelector();
@@ -119,7 +139,7 @@
 	
 	uEditDraw( 
 		uEditFetchIdentTypes(),
-		uEditFetchGroups(),
+        groups,
 		uEditFetchStatCats(),
 		uEditFetchSurveys(),
 		uEditFetchNetLevels()

Modified: trunk/Evergreen/xul/staff_client/server/patron/ue_config.js
===================================================================
--- trunk/Evergreen/xul/staff_client/server/patron/ue_config.js	2007-07-17 16:18:26 UTC (rev 7558)
+++ trunk/Evergreen/xul/staff_client/server/patron/ue_config.js	2007-07-17 16:22:20 UTC (rev 7559)
@@ -21,23 +21,6 @@
 const ADULT_AGE			= 18;
 //const GUARDIAN_NOTE		= 'SYSTEM: Parent/Guardian';
 
-/* if they don't have these perms, they shouldn't be here */
-var myPerms = [ 
-	'BAR_PATRON',
-	'group_application.user',
- 	'group_application.user.patron',
- 	'group_application.user.staff',
- 	'group_application.user.staff.circ',
- 	'group_application.user.staff.cat',
- 	'group_application.user.staff.admin.global_admin',
- 	'group_application.user.staff.admin.local_admin',
- 	'group_application.user.staff.admin.lib_manager',
- 	'group_application.user.staff.cat.cat1',
- 	'group_application.user.staff.supercat',
- 	'group_application.user.sip_client',
- 	'group_application.user.vendor'
-	];
-
 var dataFields;
 const numRegex		= /^\d+$/;
 const wordRegex	= /^[\w-]+$/;



More information about the open-ils-commits mailing list