From: erickson Date: Fri, 14 Sep 2007 20:38:27 +0000 (+0000) Subject: separate behavior for BAR_PATRON and UNBAR_PATRON perms. at present, BAR_PATRON... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a9cef946492f3c57fedd6aab2163c88aae61e515;p=Evergreen.git separate behavior for BAR_PATRON and UNBAR_PATRON perms. at present, BAR_PATRON implies that you have the UNBAR_PATRON perm. git-svn-id: svn://svn.open-ils.org/ILS/trunk@7786 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Evergreen/xul/staff_client/server/patron/ue.js b/Evergreen/xul/staff_client/server/patron/ue.js index 5fcad10c40..df2d11da17 100644 --- a/Evergreen/xul/staff_client/server/patron/ue.js +++ b/Evergreen/xul/staff_client/server/patron/ue.js @@ -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; }