added method to return parts of a user
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 20:06:43 +0000 (20:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 20:06:43 +0000 (20:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5681 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm

index f9fd2a1..97228e1 100644 (file)
@@ -2498,6 +2498,26 @@ sub new_flesh_user {
 
 
 
+__PACKAGE__->register_method(
+       method  => "user_retrieve_parts",
+       api_name        => "open-ils.actor.user.retrieve.parts",);
+
+sub user_retrieve_parts {
+       my( $self, $client, $auth, $user_id, $fields ) = @_;
+       my $e = new_editor(authtoken => $auth);
+       return $e->event unless $e->checkauth;
+       if( $e->requestor->id != $user_id ) {
+               return $e->event unless $e->allowed('VIEW_USER');
+       }
+       my @resp;
+       my $user = $e->retrieve_actor_user($user_id) or return $e->event;
+       push(@resp, $user->$_()) for(@$fields);
+       return \@resp;
+}
+
+
+
+
 
 
 1;