[open-ils-commits] r11738 - trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jan 5 11:25:56 EST 2009
Author: erickson
Date: 2009-01-05 11:25:54 -0500 (Mon, 05 Jan 2009)
New Revision: 11738
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
made open-ils.actor.user.retrieve authoritative. added CUD method for pending user addresses
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-05 14:37:09 UTC (rev 11737)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-05 16:25:54 UTC (rev 11738)
@@ -927,6 +927,7 @@
__PACKAGE__->register_method(
method => "get_user_by_id",
+ authoritative => 1,
api_name => "open-ils.actor.user.retrieve",);
sub get_user_by_id {
@@ -3160,5 +3161,34 @@
return 1;
}
+
+__PACKAGE__->register_method (
+ method => 'update_user_pending_address',
+ api_name => 'open-ils.actor.user.address.pending.cud'
+);
+
+sub update_user_pending_address {
+ my($self, $conn, $auth, $addr) = @_;
+ my $e = new_editor(authtoken => $auth, xact => 1);
+ return $e->event unless $e->checkauth;
+
+ if($addr->usr != $e->requestor->id) {
+ my $user = $e->retrieve_actor_user($addr->usr) or return $e->die_event;
+ return $e->die_event unless $e->allowed('UPDATE_USER', $user->home_ou);
+ }
+
+ if($addr->isnew) {
+ $e->create_actor_user_address($addr) or return $e->die_event;
+ } elsif($addr->isdeleted) {
+ $e->delete_actor_user_address($addr) or return $e->die_event;
+ } else {
+ $e->update_actor_user_address($addr) or return $e->die_event;
+ }
+
+ $e->commit;
+ return 1;
+}
+
+
1;
More information about the open-ils-commits
mailing list