[open-ils-commits] r10452 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Aug 26 14:13:31 EDT 2008


Author: erickson
Date: 2008-08-26 14:13:28 -0400 (Tue, 26 Aug 2008)
New Revision: 10452

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
added batch versions of the work-perm-org fetchers

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2008-08-26 14:37:18 UTC (rev 10451)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2008-08-26 18:13:28 UTC (rev 10452)
@@ -1353,10 +1353,46 @@
     /
 );
 
+__PACKAGE__->register_method(
+	method => 'check_user_work_perms_batch',
+	api_name	=> 'open-ils.actor.user.work_perm.highest_org_set.batch',
+    authoritative => 1,
+);
+__PACKAGE__->register_method(
+	method => 'check_user_work_perms_batch',
+	api_name	=> 'open-ils.actor.user.work_perm.org_tree_list.batch',
+    authoritative => 1,
+);
+__PACKAGE__->register_method(
+	method => 'check_user_work_perms_batch',
+	api_name	=> 'open-ils.actor.user.work_perm.org_unit_list.batch',
+    authoritative => 1,
+);
+__PACKAGE__->register_method(
+	method => 'check_user_work_perms_batch',
+	api_name	=> 'open-ils.actor.user.work_perm.org_id_list.batch',
+    authoritative => 1,
+);
+
+
 sub check_user_work_perms {
     my($self, $conn, $auth, $perm, $options) = @_;
     my $e = new_editor(authtoken=>$auth);
     return $e->event unless $e->checkauth;
+    return check_user_work_perms_impl($self, $conn, $e, $perm, $options);
+}
+
+sub check_user_work_perms_batch {
+    my($self, $conn, $auth, $perm_list, $options) = @_;
+    my $e = new_editor(authtoken=>$auth);
+    return $e->event unless $e->checkauth;
+    my $map = {};
+    $map->{$_} = check_user_work_perms_impl($self, $conn, $e, $_, $options) for @$perm_list;
+    return $map;
+}
+
+sub check_user_work_perms_impl {
+    my($self, $conn, $e, $perm, $options) = @_;
     my $orglist = $U->find_highest_work_orgs($e, $perm, $options);
 
     return $orglist if $self->api_name =~ /highest_org_set/;



More information about the open-ils-commits mailing list