[open-ils-commits] r19678 - in branches/rel_2_1/Open-ILS: web/opac/locale/en-US xul/staff_client/server/admin (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 10 09:25:06 EST 2011
Author: erickson
Date: 2011-03-10 09:25:04 -0500 (Thu, 10 Mar 2011)
New Revision: 19678
Modified:
branches/rel_2_1/Open-ILS/web/opac/locale/en-US/lang.dtd
branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
Log:
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
Modified: branches/rel_2_1/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_2_1/Open-ILS/web/opac/locale/en-US/lang.dtd 2011-03-10 14:24:18 UTC (rev 19677)
+++ branches/rel_2_1/Open-ILS/web/opac/locale/en-US/lang.dtd 2011-03-10 14:25:04 UTC (rev 19678)
@@ -1734,6 +1734,7 @@
<!ENTITY staff.server.admin.org_unit_settings.title "Organization Unit Settings">
<!ENTITY staff.server.admin.org_unit_settings.context "Context Location">
<!ENTITY staff.server.admin.org_unit_settings.uninherited " * Indicates the setting is not inherited from the parent org unit at run time">
+<!ENTITY staff.server.admin.org_unit_settings.no_perms "You do not have permission to view org unit settings">
<!ENTITY staff.server.admin.org_unit_settings.edit_setting "Edit Setting">
<!ENTITY staff.server.admin.org_unit_settings.delete_setting "Delete Setting">
<!ENTITY staff.server.admin.org_unit_settings.update_setting "Update Setting">
Modified: branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js
===================================================================
--- branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js 2011-03-10 14:24:18 UTC (rev 19677)
+++ branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.js 2011-03-10 14:25:04 UTC (rev 19678)
@@ -29,10 +29,20 @@
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);
- osDraw();
+ // 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');
+ }
+ });
+ };
+
+ new openils.User().buildPermOrgSelector('VIEW_ORG_SETTINGS', osContextSelector, null, connect);
}
dojo.addOnLoad(osInit);
Modified: branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml
===================================================================
--- branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml 2011-03-10 14:24:18 UTC (rev 19677)
+++ branches/rel_2_1/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml 2011-03-10 14:25:04 UTC (rev 19678)
@@ -40,6 +40,9 @@
</span>
<span>&staff.server.admin.org_unit_settings.uninherited;</span>
</div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <div class='hide_me' id='no-perms'><b>&staff.server.admin.org_unit_settings.no_perms;</b></div>
+ </div>
<div dojoType="dijit.layout.ContentPane" layoutAlign='client' class='tall'>
<script>
var osGridLayout = [{
More information about the open-ils-commits
mailing list