( 507, 'ABORT_TRANSIT_ON_LOST', oils_i18n_gettext(507,
'Allows a user to abort a transit on a copy with status of LOST', 'ppl', 'description')),
( 508, 'ABORT_TRANSIT_ON_MISSING', oils_i18n_gettext(508,
- 'Allows a user to abort a transit on a copy with status of MISSING', 'ppl', 'description'));
+ 'Allows a user to abort a transit on a copy with status of MISSING', 'ppl', 'description')),
+ ( 509, 'UPDATE_PATRON_COLLECTIONS_EXEMPT', oils_i18n_gettext(509,
+ 'Allows a user to indicate that a patron is exempt from collections processing', 'ppl', 'description'));
SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
'VIEW_CIRC_MATRIX_MATCHPOINT',
'ABORT_TRANSIT_ON_LOST',
'ABORT_TRANSIT_ON_MISSING',
+ 'UPDATE_PATRON_COLLECTIONS_EXEMPT',
'VIEW_HOLD_MATRIX_MATCHPOINT');
INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
var row = template.cloneNode(true);
row.setAttribute('user_setting', stype.name());
getByName(row, 'label').innerHTML = stype.label();
- var cb = new dijit.form.CheckBox({scrollOnFocus:false}, getByName(row, 'widget'));
+ var cbArgs = {scrollOnFocus : false};
+
+ if(stype.name() == 'circ.collections.exempt') {
+ // Staff require a special permission to exempt a user from collections
+
+ var perm = fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.user.has_work_perm_at'],
+ [openils.User.authtoken, 'UPDATE_PATRON_COLLECTIONS_EXEMPT']);
+
+ /* If and until we implement recalc-perms on a patron home-lib change, having the
+ * perm at any org unit is sufficient. This should be considered a gobal permission.
+ */
+ if(perm.length == 0)
+ cbArgs.disabled = true;
+ }
+
+ var cb = new dijit.form.CheckBox(cbArgs, getByName(row, 'widget'));
cb.attr('value', userSettings[stype.name()]);
dojo.connect(cb, 'onChange', function(newVal) { userSettingsToUpdate[stype.name()] = newVal; });
tbody.insertBefore(row, dividerRow.nextSibling);