dojo.connect(oilsFSOverAllocateOverride, 'onClick',
function() {
oilsFSOverAllocateDialog.hide();
- doAllocation(fields);
+
+ // Are we allowed to touch the barred state?
+ var permission = 'ACQ_OVERRIDE_OVER_ALLOCATION';
+ var staff = new openils.User().user;
+ var ou = staff.ws_ou();
+ var resp = fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.user.perm.check'],
+ { params : [openils.User.authtoken, staff.id(), ou, [permission] ] }
+ );
+ if(!resp[0]) {
+ doAllocation(fields);
+ }
}
);