Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
1bfbd62f
Commit
1bfbd62f
authored
Feb 14, 2014
by
Bertrand Gauthier
Browse files
Support des rôles fournis au format Traversable.
parent
2b7d8563
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Provider/Identity/Db.php
View file @
1bfbd62f
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment