[open-ils-commits] r7990 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Nov 4 14:41:41 EST 2007
Author: erickson
Date: 2007-11-04 14:26:22 -0500 (Sun, 04 Nov 2007)
New Revision: 7990
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
repaired renewal permission check logic
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2007-11-04 19:18:35 UTC (rev 7989)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2007-11-04 19:26:22 UTC (rev 7990)
@@ -1942,11 +1942,6 @@
$self->log_me("do_renew()");
$self->is_renewal(1);
- unless( $self->is_renewal ) {
- return $self->bail_on_events($self->editor->events)
- unless $self->editor->allowed('RENEW_CIRC');
- }
-
# Make sure there is an open circ to renew that is not
# marked as LOST, CLAIMSRETURNED, or LONGOVERDUE
my $circ = $self->editor->search_action_circulation(
@@ -1964,6 +1959,12 @@
return $self->bail_on_events($self->editor->event) unless $circ;
+ # A user is not allowed to renew another user's items without permission
+ unless( $circ->usr eq $self->editor->requestor->id ) {
+ return $self->bail_on_events($self->editor->events)
+ unless $self->editor->allowed('RENEW_CIRC', $circ->circ_lib);
+ }
+
$self->push_events(OpenILS::Event->new('MAX_RENEWALS_REACHED'))
if $circ->renewal_remaining < 1;
More information about the open-ils-commits
mailing list