/* ------------------------------------------------------------------------------ */
+/*
+ * 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();
uEditDraw(
uEditFetchIdentTypes(),
- uEditFetchGroups(),
+ groups,
uEditFetchStatCats(),
uEditFetchSurveys(),
uEditFetchNetLevels()
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-]+$/;