my $evt;
my $hold;
- if( $transit->copy_status == OILS_COPY_STATUS_LOST or
- $transit->copy_status == OILS_COPY_STATUS_MISSING ) {
+ if( ($transit->copy_status == OILS_COPY_STATUS_LOST and !$e->allowed('ABORT_TRANSIT_ON_LOST')) or
+ ($transit->copy_status == OILS_COPY_STATUS_MISSING and !$e->allowed('ABORT_TRANSIT_ON_MISSING')) ) {
$e->rollback;
- return OpenILS::Event->new('TRANSIT_ABORT_NOT_ALLOWED');
+ return OpenILS::Event->new('TRANSIT_ABORT_NOT_ALLOWED', copy_status => $transit->copy_status);
}
if( $transit->dest != $e->requestor->ws_ou
and $transit->source != $e->requestor->ws_ou ) {
- return $e->event unless $e->allowed('ABORT_REMOTE_TRANSIT', $e->requestor->ws_ou);
+ return $e->die_event unless $e->allowed('ABORT_REMOTE_TRANSIT', $e->requestor->ws_ou);
}
# recover the copy status
$copy->status( OILS_COPY_STATUS_RESHELVING );
}
- return $e->event unless $e->delete_action_transit_copy($transit);
- return $e->event unless $e->update_asset_copy($copy);
+ return $e->die_event unless $e->delete_action_transit_copy($transit);
+ return $e->die_event unless $e->update_asset_copy($copy);
$e->commit;
# if this is a hold transit, un-capture/un-target the hold
if($holdtransit and !$no_reset_hold) {
- $hold = $e->retrieve_action_hold_request($holdtransit->hold)
- or return $e->event;
+ $hold = $e->retrieve_action_hold_request($holdtransit->hold)
+ or return $e->die_event;
$evt = $holdcode->_reset_hold( $e->requestor, $hold );
return $evt if $evt;
}
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0543', :eg_version); -- dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0545', :eg_version); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
( 505, 'UPDATE_WORKSTATION', oils_i18n_gettext(505,
'Allows update of a workstation during workstation registration override.', 'ppl', 'description')),
( 506, 'VIEW_USER_SETTING_TYPE', oils_i18n_gettext(506,
- 'Allows viewing of configurable user setting types.', 'ppl', 'description'));
+ 'Allows viewing of configurable user setting types.', 'ppl', 'description')),
+ ( 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'));
SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
'UPDATE_HOLD_REQUEST_TIME',
'UPDATE_NET_ACCESS_LEVEL',
'VIEW_CIRC_MATRIX_MATCHPOINT',
+ 'ABORT_TRANSIT_ON_LOST',
+ 'ABORT_TRANSIT_ON_MISSING',
'VIEW_HOLD_MATRIX_MATCHPOINT');
INSERT INTO permission.grp_perm_map (grp, perm, depth, grantable)
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0545', :eg_version);
+
+INSERT INTO permission.perm_list VALUES
+ (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'));
+
+--- stock Circulation Administrator group
+
+INSERT INTO permission.grp_perm_map ( grp, perm, depth, grantable )
+ SELECT
+ 4,
+ id,
+ 0,
+ 't'
+ FROM permission.perm_list
+ WHERE code in ('ABORT_TRANSIT_ON_LOST', 'ABORT_TRANSIT_ON_MISSING');
+
+COMMIT;