From 6992bf3615a5b2431181b1af7e5bc4a2472bc783 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 25 Oct 2013 15:05:40 +0200 Subject: [PATCH] Fix ACL cache issue --- lib/classes/ACL.php | 5 +++++ lib/classes/User/Adapter.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/classes/ACL.php b/lib/classes/ACL.php index cdd45a0dc7..8d14877ef6 100644 --- a/lib/classes/ACL.php +++ b/lib/classes/ACL.php @@ -119,6 +119,11 @@ class ACL implements cache_cacheableInterface return $this; } + public function set_app(Application $app) + { + $this->app = $app; + } + /** * Check if a hd grant has been received for a record * diff --git a/lib/classes/User/Adapter.php b/lib/classes/User/Adapter.php index 620a6956a7..ae1d0fdb1f 100644 --- a/lib/classes/User/Adapter.php +++ b/lib/classes/User/Adapter.php @@ -370,6 +370,8 @@ class User_Adapter implements User_Interface, cache_cacheableInterface self::$_instance[$id] = new self($id, $app); $app['phraseanet.appbox']->set_data_to_cache(self::$_instance[$id], '_user_' . $id); } + } else { + self::$_instance[$id]->set_app($app); } return array_key_exists($id, self::$_instance) ? self::$_instance[$id] : false; @@ -392,6 +394,9 @@ class User_Adapter implements User_Interface, cache_cacheableInterface protected function set_app(Application $app) { $this->app = $app; + if (null !== $this->ACL) { + $this->ACL->set_app($app); + } } /**