forward porting : svn merge -r7557:7558 svn://svn.open-ils.org/ILS/branches/rel_1_2/ .
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Jul 2007 16:22:20 +0000 (16:22 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Jul 2007 16:22:20 +0000 (16:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7559 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/xul/staff_client/server/patron/ue.js
Evergreen/xul/staff_client/server/patron/ue_config.js

index 6c3da55..5fcad10 100644 (file)
@@ -105,9 +105,29 @@ function uEditFetchNetLevels() {
 /* ------------------------------------------------------------------------------ */
 
 
+/*  
+ * 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 @@ function uEditBuild() {
        
        uEditDraw( 
                uEditFetchIdentTypes(),
-               uEditFetchGroups(),
+        groups,
                uEditFetchStatCats(),
                uEditFetchSurveys(),
                uEditFetchNetLevels()
index 6417e4f..dc80e18 100644 (file)
@@ -21,23 +21,6 @@ const CSS_INVALID_DATA       = 'invalid_value';
 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-]+$/;