[open-ils-commits] r9149 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 27 02:01:46 EDT 2008
Author: miker
Date: 2008-03-27 01:26:22 -0400 (Thu, 27 Mar 2008)
New Revision: 9149
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm
Log:
procting permacrud search from failed retrieve
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm 2008-03-27 05:25:29 UTC (rev 9148)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/PermaCrud.pm 2008-03-27 05:26:22 UTC (rev 9149)
@@ -59,7 +59,7 @@
my $auth = shift;
my $obj = shift;
- my $e = new_editor(authtoken => $auth, xact => 1);
+ my $e = shift || new_editor(authtoken => $auth, xact => 1);
return $e->event unless $e->checkauth;
if (ref($obj) && $obj->json_hint ne $self->{class_hint}) {
@@ -123,7 +123,7 @@
my $perm_field_value = $action_node->getAttribute('permission');
if ($perm_field_value) {
- my @perms = split '\|', $action_node->getAttribute('permission');
+ my @perms = split '\|', $perm_field_value;
my @context_ous;
if ($action_node->getAttribute('global_required')) {
@@ -175,7 +175,7 @@
if ((lc($all_perms) eq 'true' && @perms != $pok) or !$pok) {
throw OpenSRF::DomainObject::oilsException->new(
- statusCode => 500,
+ statusCode => 403,
status => "Perm failure -- action: $self->{action}, object type: $self->{json_hint}",
);
}
@@ -224,8 +224,10 @@
my $retriever = $self->method_lookup( $self->{retriever} );
for my $o ( @$obj_list ) {
- my ($o) = $retriever->run( $auth, $o );
- $client->respond( $o ) if ($o);
+ try {
+ ($o) = $retriever->run( $auth, $o, $e );
+ $client->respond( $o ) if ($o);
+ };
}
return undef;
More information about the open-ils-commits
mailing list