From 88318affc21bb251a73cf891791e06b337dce5b1 Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Thu, 11 Feb 2010 20:19:18 +0000
Subject: [PATCH] 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
---
 Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
         }
 	}
 
-- 
2.11.0