From: erickson Date: Mon, 14 Apr 2008 14:04:20 +0000 (+0000) Subject: added a parallel method for perm_org_set which returns the sub-tree for each of the... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6e4e7cf8219cea35555e7519f60f87339d2b7719;p=Evergreen.git added a parallel method for perm_org_set which returns the sub-tree for each of the perm orgs git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9341 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 92a7b14bcf..5b711f3e64 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1309,13 +1309,28 @@ __PACKAGE__->register_method( } ); +__PACKAGE__->register_method( + method => 'check_user_work_perms', + api_name => 'open-ils.actor.user.work_perm.highest_org_tree_set', + authoritative => 1, + signature => q/ + @see open-ils.actor.user.work_perm.highest_org_set + Returns a list of org trees. The root of each tree + is the highest org in the organization hierarchy where the user has the + requested permission. Below each tree root is its full tree of descendants. + / +); + sub check_user_work_perms { my($self, $conn, $auth, $perm, $options) = @_; my $e = new_editor(authtoken=>$auth); return $e->event unless $e->checkauth; - return $U->find_highest_work_orgs($e, $perm, $options); + my $orglist = $U->find_highest_work_orgs($e, $perm, $options); + return $orglist unless $self->api_name =~ /tree/; + return get_org_descendants($self, $conn, $orglist); } + __PACKAGE__->register_method( method => 'check_user_perms4', api_name => 'open-ils.actor.user.perm.highest_org.batch',