Loading config/module.config.php +0 −2 Original line number Diff line number Diff line <?php use Interop\Container\ContainerInterface; return [ 'bjyauthorize' => [ // default role for unauthenticated users Loading src/BjyAuthorize/Controller/Plugin/IsAllowedFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace BjyAuthorize\Controller\Plugin; use Interop\Container\ContainerInterface; use Psr\Container\ContainerInterface; class IsAllowedFactory { Loading src/BjyAuthorize/Module.php +1 −1 Original line number Diff line number Diff line Loading @@ -35,9 +35,9 @@ class Module implements // transmission des ACL aux aides de vue de navigation $authorizeService = $serviceManager->get('BjyAuthorize\Service\Authorize'); /* @var $authorizeService \BjyAuthorize\Service\Authorize */ Navigation::setDefaultAcl($authorizeService->getAcl()); Navigation::setDefaultRole($authorizeService->getIdentity()); foreach ($guards as $guard) { /** @var AbstractListenerAggregate $guard */ $guard->attach($app->getEventManager()); Loading src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider; use Interop\Container\ContainerInterface; use Psr\Container\ContainerInterface; use Laminas\ServiceManager\FactoryInterface; use Laminas\ServiceManager\ServiceLocatorInterface; Loading src/BjyAuthorize/Service/Authorize.php +5 −6 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ use BjyAuthorize\Provider\Identity\ProviderInterface as IdentityProvider; use BjyAuthorize\Provider\Resource\ProviderInterface as ResourceProvider; use BjyAuthorize\Provider\Role\ProviderInterface as RoleProvider; use BjyAuthorize\Provider\Rule\ProviderInterface as RuleProvider; use Interop\Container\Exception\NotFoundException; use Laminas\Cache\Storage\StorageInterface; use Laminas\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Exception\InvalidArgumentException; Loading @@ -22,6 +21,7 @@ use Laminas\Permissions\Acl\Resource\GenericResource; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\ServiceManager\Exception\ServiceNotFoundException; use Laminas\ServiceManager\ServiceLocatorInterface; use UnicaenApp\Util; /** * Authorize service Loading Loading @@ -380,16 +380,16 @@ class Authorize $ruleSize = count($rule); if (4 === $ruleSize) { list($roles, $resources, $privileges, $assertion) = $rule; [$roles, $resources, $privileges, $assertion] = $rule; try { $assertion = $this->serviceLocator->get($assertion); } catch (ServiceNotFoundException $nfe) { throw new \RuntimeException("Impossible d'obtenir l'assertion '$assertion'", null, $nfe); } } elseif (3 === $ruleSize) { list($roles, $resources, $privileges) = $rule; [$roles, $resources, $privileges] = $rule; } elseif (2 === $ruleSize) { list($roles, $resources) = $rule; [$roles, $resources] = $rule; } else { throw new \InvalidArgumentException('Invalid rule definition: ' . print_r($rule, true)); } Loading Loading @@ -431,11 +431,9 @@ class Authorize foreach ($this->roleProviders as $provider) { $this->addRoles($provider->getRoles()); } foreach ($this->resourceProviders as $provider) { $this->loadResource($provider->getResources(), null); } foreach ($this->ruleProviders as $provider) { $rules = $provider->getRules(); if (isset($rules['allow'])) { Loading @@ -450,5 +448,6 @@ class Authorize } } } } } Loading
config/module.config.php +0 −2 Original line number Diff line number Diff line <?php use Interop\Container\ContainerInterface; return [ 'bjyauthorize' => [ // default role for unauthenticated users Loading
src/BjyAuthorize/Controller/Plugin/IsAllowedFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ namespace BjyAuthorize\Controller\Plugin; use Interop\Container\ContainerInterface; use Psr\Container\ContainerInterface; class IsAllowedFactory { Loading
src/BjyAuthorize/Module.php +1 −1 Original line number Diff line number Diff line Loading @@ -35,9 +35,9 @@ class Module implements // transmission des ACL aux aides de vue de navigation $authorizeService = $serviceManager->get('BjyAuthorize\Service\Authorize'); /* @var $authorizeService \BjyAuthorize\Service\Authorize */ Navigation::setDefaultAcl($authorizeService->getAcl()); Navigation::setDefaultRole($authorizeService->getIdentity()); foreach ($guards as $guard) { /** @var AbstractListenerAggregate $guard */ $guard->attach($app->getEventManager()); Loading
src/BjyAuthorize/Service/AuthenticationIdentityProviderServiceFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ namespace BjyAuthorize\Service; use BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider; use Interop\Container\ContainerInterface; use Psr\Container\ContainerInterface; use Laminas\ServiceManager\FactoryInterface; use Laminas\ServiceManager\ServiceLocatorInterface; Loading
src/BjyAuthorize/Service/Authorize.php +5 −6 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ use BjyAuthorize\Provider\Identity\ProviderInterface as IdentityProvider; use BjyAuthorize\Provider\Resource\ProviderInterface as ResourceProvider; use BjyAuthorize\Provider\Role\ProviderInterface as RoleProvider; use BjyAuthorize\Provider\Rule\ProviderInterface as RuleProvider; use Interop\Container\Exception\NotFoundException; use Laminas\Cache\Storage\StorageInterface; use Laminas\Permissions\Acl\Acl; use Laminas\Permissions\Acl\Exception\InvalidArgumentException; Loading @@ -22,6 +21,7 @@ use Laminas\Permissions\Acl\Resource\GenericResource; use Laminas\Permissions\Acl\Resource\ResourceInterface; use Laminas\ServiceManager\Exception\ServiceNotFoundException; use Laminas\ServiceManager\ServiceLocatorInterface; use UnicaenApp\Util; /** * Authorize service Loading Loading @@ -380,16 +380,16 @@ class Authorize $ruleSize = count($rule); if (4 === $ruleSize) { list($roles, $resources, $privileges, $assertion) = $rule; [$roles, $resources, $privileges, $assertion] = $rule; try { $assertion = $this->serviceLocator->get($assertion); } catch (ServiceNotFoundException $nfe) { throw new \RuntimeException("Impossible d'obtenir l'assertion '$assertion'", null, $nfe); } } elseif (3 === $ruleSize) { list($roles, $resources, $privileges) = $rule; [$roles, $resources, $privileges] = $rule; } elseif (2 === $ruleSize) { list($roles, $resources) = $rule; [$roles, $resources] = $rule; } else { throw new \InvalidArgumentException('Invalid rule definition: ' . print_r($rule, true)); } Loading Loading @@ -431,11 +431,9 @@ class Authorize foreach ($this->roleProviders as $provider) { $this->addRoles($provider->getRoles()); } foreach ($this->resourceProviders as $provider) { $this->loadResource($provider->getResources(), null); } foreach ($this->ruleProviders as $provider) { $rules = $provider->getRules(); if (isset($rules['allow'])) { Loading @@ -450,5 +448,6 @@ class Authorize } } } } }