Commit d0b45011 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Accès au flashMessengher depuis les assertions

parent 35ab756c
......@@ -5,6 +5,7 @@ namespace UnicaenAuth\Assertion;
use BjyAuthorize\Service\Authorize;
use UnicaenAuth\Service\Traits\UserContextServiceAwareTrait;
use Zend\Mvc\Application;
use Zend\Mvc\Controller\Plugin\FlashMessenger;
use Zend\Mvc\MvcEvent;
use Zend\Permissions\Acl\Acl;
use Zend\Permissions\Acl\Assertion\AssertionInterface;
......@@ -33,6 +34,11 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw
*/
private $role = false;
/**
* @var FlashMessenger
*/
private $fm;
/**
......@@ -293,4 +299,17 @@ abstract class AbstractAssertion implements AssertionInterface, ServiceLocatorAw
return $serviceAuthorize;
}
/**
* @return FlashMessenger
*/
protected function flashMessenger()
{
if (!$this->fm){
$this->fm = $this->getServiceLocator()->get('controllerpluginmanager')->get('flashmessenger');
}
return $this->fm;
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment