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

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 14 16:46:38 EDT 2007


Author: erickson
Date: 2007-09-14 16:38:27 -0400 (Fri, 14 Sep 2007)
New Revision: 7786

Modified:
   trunk/Evergreen/xul/staff_client/server/patron/ue.js
Log:
separate behavior for BAR_PATRON and UNBAR_PATRON perms.  at present, BAR_PATRON implies that you have the UNBAR_PATRON perm.

Modified: trunk/Evergreen/xul/staff_client/server/patron/ue.js
===================================================================
--- trunk/Evergreen/xul/staff_client/server/patron/ue.js	2007-09-14 15:49:22 UTC (rev 7785)
+++ trunk/Evergreen/xul/staff_client/server/patron/ue.js	2007-09-14 20:38:27 UTC (rev 7786)
@@ -121,7 +121,7 @@
 /* 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,11 +160,20 @@
 		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;
+}
+
+
 /* if this user does not have permission to put users into
 	the edited users group, they do not have permission to 
 	edit this user */



More information about the open-ils-commits mailing list