From 55888df0d9a03b7a25836598274e61ea359c4173 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 10 Mar 2011 14:24:18 +0000 Subject: [PATCH] as an alternate/addition to applying per-setting permissions, use the existing VIEW_ORG_SETTINGS permission as a general gateway into the org settings UI git-svn-id: svn://svn.open-ils.org/ILS/trunk@19677 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 1 + .../staff_client/server/admin/org_unit_settings.js | 18 ++++++++++++++---- .../server/admin/org_unit_settings.xhtml | 3 +++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 648090b..07e5404 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1734,6 +1734,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js index b275eb7..82f0475 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js @@ -29,10 +29,20 @@ function osInit(data) { contextOrg = user.user.ws_ou(); openils.User.authtoken = authtoken; - var connect = function() { dojo.connect(contextOrg, 'onChange', osChangeContext); }; - new openils.User().buildPermOrgSelector('STAFF_LOGIN', osContextSelector, null, connect); + var connect = function() { + dojo.connect(contextOrg, 'onChange', osChangeContext); + + // don't draw the org settings grid unless the user has permission + // to view org settings in at least 1 org unit + osContextSelector.store.fetch({query: {}, start: 0, count: 0, + onBegin: function(size) { + if(size) { osDraw(); return; } + dojo.removeClass('no-perms', 'hide_me'); + } + }); + }; - osDraw(); + new openils.User().buildPermOrgSelector('VIEW_ORG_SETTINGS', osContextSelector, null, connect); } dojo.addOnLoad(osInit); diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index 2862fba..017ab39 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -40,6 +40,9 @@ &staff.server.admin.org_unit_settings.uninherited; +
+
&staff.server.admin.org_unit_settings.no_perms;
+