From 1d1cc64984b26cbe2e1c70fc289a8ea3da7bc2f1 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 26 Aug 2008 18:13:28 +0000 Subject: [PATCH] added batch versions of the work-perm-org fetchers git-svn-id: svn://svn.open-ils.org/ILS/trunk@10452 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Actor.pm | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 7eacf9c36e..7805652085 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1353,10 +1353,46 @@ __PACKAGE__->register_method( / ); +__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/; -- 2.43.2