Fix ACL cache issue

This commit is contained in:
Romain Neutron
2013-10-25 15:05:40 +02:00
parent 6a53038803
commit 35e9e692d2
2 changed files with 10 additions and 0 deletions

View File

@@ -119,6 +119,11 @@ class ACL implements cache_cacheableInterface
return $this; return $this;
} }
public function set_app(Application $app)
{
$this->app = $app;
}
/** /**
* Check if a hd grant has been received for a record * Check if a hd grant has been received for a record
* *

View File

@@ -370,6 +370,8 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
self::$_instance[$id] = new self($id, $app); self::$_instance[$id] = new self($id, $app);
$app['phraseanet.appbox']->set_data_to_cache(self::$_instance[$id], '_user_' . $id); $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; 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) protected function set_app(Application $app)
{ {
$this->app = $app; $this->app = $app;
if (null !== $this->ACL) {
$this->ACL->set_app($app);
}
} }
/** /**