[open-ils-commits] r9618 -
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 15 11:15:30 EDT 2008
Author: erickson
Date: 2008-05-15 11:15:28 -0400 (Thu, 15 May 2008)
New Revision: 9618
Modified:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
Log:
added li_provider_attr_def delete
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm 2008-05-15 14:55:23 UTC (rev 9617)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm 2008-05-15 15:15:28 UTC (rev 9618)
@@ -145,11 +145,39 @@
return $e->die_event unless $e->checkauth;
my $provider = $e->retrieve_acq_provider($attr_def->provider)
or return $e->die_event;
- return $e->event unless $e->allowed('ADMIN_PROVIDER', $provider->owner);
+ return $e->die_event unless $e->allowed('ADMIN_PROVIDER', $provider->owner);
$e->create_acq_lineitem_provider_attr_definition($attr_def)
or return $e->die_event;
$e->commit;
return $attr_def->id;
}
+__PACKAGE__->register_method(
+ method => 'delete_provider_attr_def',
+ api_name => 'open-ils.acq.lineitem_provider_attr_definition.delete',
+ signature => {
+ desc => 'Deletes a lineitem_provider_attr_definition',
+ params => [
+ {desc => 'Authentication token', type => 'string'},
+ {desc => 'ID', type => 'number'}
+ ],
+ return => {desc => '1 on success, event on failure'}
+ }
+);
+
+sub delete_provider_attr_def {
+ my($self, $conn, $auth, $id) = @_;
+ my $e = new_editor(authtoken=>$auth, xact=>1);
+ return $e->die_event unless $e->checkauth;
+ my $attr_def = $e->retrieve_acq_lineitem_provider_attr_definition($id)
+ or return $e->die_event;
+ my $provider = $e->retrieve_acq_provider($attr_def->provider)
+ or return $e->die_event;
+ return $e->die_event unless $e->allowed('ADMIN_PROVIDER', $provider->owner);
+ $e->delete_acq_lineitem_provider_attr_definition($attr_def)
+ or return $e->die_event;
+ $e->commit;
+ return 1;
+}
+
1;
More information about the open-ils-commits
mailing list