From 24cfd18ca0da89fd6eadd1665d2e48dabede2ccb Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 17 Jul 2007 16:22:20 +0000 Subject: [PATCH] forward porting : svn merge -r7557:7558 svn://svn.open-ils.org/ILS/branches/rel_1_2/ . git-svn-id: svn://svn.open-ils.org/ILS/trunk@7559 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/patron/ue.js | 24 +++++++++++++++++-- .../staff_client/server/patron/ue_config.js | 17 ------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Evergreen/xul/staff_client/server/patron/ue.js b/Evergreen/xul/staff_client/server/patron/ue.js index 6c3da55159..5fcad10c40 100644 --- a/Evergreen/xul/staff_client/server/patron/ue.js +++ b/Evergreen/xul/staff_client/server/patron/ue.js @@ -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() diff --git a/Evergreen/xul/staff_client/server/patron/ue_config.js b/Evergreen/xul/staff_client/server/patron/ue_config.js index 6417e4f99e..dc80e1802a 100644 --- a/Evergreen/xul/staff_client/server/patron/ue_config.js +++ b/Evergreen/xul/staff_client/server/patron/ue_config.js @@ -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-]+$/; -- 2.43.2