<!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">
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);
</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 = [{