separate behavior for BAR_PATRON and UNBAR_PATRON perms. at present, BAR_PATRON...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Sep 2007 20:38:27 +0000 (20:38 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Sep 2007 20:38:27 +0000 (20:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7786 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 5fcad10..df2d11d 100644 (file)
@@ -121,7 +121,7 @@ function buildAppPermList(list, group) {
 /* fetches necessary objects and builds the UI */
 function uEditBuild() {
 
-    myPerms = ['BAR_PATRON'];
+    myPerms = ['BAR_PATRON', 'UNBAR_PATRON'];
 
     /*  grab the groups before we check perms so we know what
         application_perms to check */
@@ -160,8 +160,17 @@ function uEditBuild() {
                uEditCheckEditPerm();
        }
 
-       if(PERMS['BAR_PATRON'] == -1) 
-               $('ue_barred').disabled = true;
+    uEditCheckBarredPerm();
+}
+
+function uEditCheckBarredPerm() {
+       if(PERMS['BAR_PATRON'] != -1) 
+        return;
+
+    if(isTrue(patron.barred()) && PERMS['UNBAR_PATRON'] != -1) 
+        return;
+
+    $('ue_barred').disabled = true;
 }