Commit 1bfbd62f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Support des rôles fournis au format Traversable.

parent 2b7d8563
......@@ -4,6 +4,7 @@ namespace UnicaenAuth\Provider\Identity;
use BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider;
use BjyAuthorize\Provider\Role\ProviderInterface;
use ZfcUser\Entity\UserInterface;
use Traversable;
* Classe de fournisseur d'identité issue de la base de données des utilisateurs.
......@@ -40,6 +41,9 @@ class Db extends AuthenticationIdentityProvider implements ChainableProvider
if ($identity instanceof ProviderInterface) {
$roles = $identity->getRoles();
if ($roles instanceof Traversable) {
$roles = iterator_to_array($roles);
else {
$roles = array();
Supports Markdown
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