Commit 55637ab2 authored by Bertrand Gauthier's avatar Bertrand Gauthier

Module.php : les erreurs de services introuvables lors du chargement des ACL étaiaent tues.

parent 7e3cf398
......@@ -9,7 +9,7 @@ use Zend\EventManager\EventInterface;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ModuleManager\ModuleManager;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Helper\Navigation;
use ZfcUser\Form\Login;
......@@ -69,14 +69,12 @@ class Module implements AutoloaderProviderInterface, ConfigProviderInterface, Se
/* @var $services \Zend\ServiceManager\ServiceManager */
$services = $application->getServiceManager();
// transmission des ACL aux aides de vue de navigation
try {
if ($services->has('BjyAuthorize\Service\Authorize')) {
// transmission des ACL aux aides de vue de navigation
$authorizeService = $services->get('BjyAuthorize\Service\Authorize');
/* @var $authorizeService \BjyAuthorize\Service\Authorize */
Navigation::setDefaultAcl($authorizeService->getAcl());
Navigation::setDefaultRole($authorizeService->getIdentity());
} catch (ServiceNotFoundException $snfe) {
// pas de module BjyAuthorize : pas d'ACL
}
/* @var $options ModuleOptions */
......
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