From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Thu, 11 Feb 2010 20:19:18 +0000 (+0000)
Subject: Use the home library of the bucket owner as the context org for the VIEW_CONTAINER... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=88318affc21bb251a73cf891791e06b337dce5b1;p=evergreen%2Fpines.git

Use the home library of the bucket owner as the context org for the VIEW_CONTAINER permission

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15507 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm
index c3d85d0fca..de6986e79d 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm
@@ -97,7 +97,9 @@ sub _bucket_flesh {
 	unless($U->is_true($bkt->pub)) {
         return undef if $self->api_name =~ /public/;
         unless($bkt->owner eq $e->requestor->id) {
-            return $e->event unless $e->allowed('VIEW_CONTAINER', $bkt);
+            my $owner = $e->retrieve_actor_user($bkt->owner)
+                or return $e->die_event;
+            return $e->event unless $e->allowed('VIEW_CONTAINER', $owner->home_ou);
         }
 	}