[open-ils-commits] r8940 -
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 9 16:21:42 EDT 2008
Author: erickson
Date: 2008-03-09 15:48:44 -0400 (Sun, 09 Mar 2008)
New Revision: 8940
Modified:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
Log:
more PO updates to match new table layout. repaired permission check for PO retrieval
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2008-03-09 19:20:17 UTC (rev 8939)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm 2008-03-09 19:48:44 UTC (rev 8940)
@@ -545,17 +545,11 @@
return $e->die_event unless $e->checkauth;
$p_order->owner($e->requestor->id);
- if($p_order->default_fund) {
- # if a default fund is provided, make sure the requestor
- # actually has permission to spend from that fund
- my $fund = $e->retrieve_acq_fund($p_order->default_fund)
- or return $e->die_event;
- return $e->die_event unless $e->allowed('MANAGE_FUND', $fund->org, $fund);
- }
-
my $provider = $e->retrieve_acq_provider($p_order->provider)
or return $e->die_event;
+ $p_order->ordering_agency($e->requestor->ws_ou) or return $e->die_event;
+
return $e->die_event unless $e->allowed('MANAGE_PROVIDER', $provider->owner, $provider);
$e->create_acq_purchase_order($p_order) or return $e->die_event;
@@ -597,6 +591,8 @@
# grab purchase orders I have
my $perm_orgs = $U->find_highest_work_orgs($e, 'MANAGE_PROVIDER', {descendants =>1});
+ return OpenILS::Event->new('PERM_FAILURE', ilsperm => 'MANAGE_PROVIDER')
+ unless @$perm_orgs;
my $provider_ids = $e->search_acq_provider({owner => $perm_orgs}, {idlist=>1});
my $po_ids = $e->search_acq_purchase_order({provider => $provider_ids}, {idlist=>1});
@@ -656,11 +652,8 @@
my $provider = $e->retrieve_acq_provider($po->provider) or return $e->event;
return $e->event unless $e->allowed('MANAGE_PROVIDER', $provider->owner, $provider);
if($fund_id) {
- my $fund = $e->retrieve_acq_fund($po->default_fund);
+ my $fund = $e->retrieve_acq_fund($po->$fund_id);
return $e->event unless $e->allowed('MANAGE_FUND', $fund->org, $fund);
- } elsif($po->default_fund) {
- my $fund = $e->retrieve_acq_fund($po->default_fund);
- return $e->event unless $e->allowed('MANAGE_FUND', $fund->org, $fund);
}
return undef;
}
More information about the open-ils-commits
mailing list