Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #87 from Nitecon/master
Browse files Browse the repository at this point in the history
Validate has identity exists and try to use it before attempting to pull...
  • Loading branch information
bakura10 committed Oct 8, 2013
2 parents 0ed6c2f + 3b99ff2 commit b25d8fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ZfcRbac/Collector/RbacCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ public function collect(MvcEvent $mvcEvent)
$this->collectedOptions = $rbacConfig;
$identityProvider = $sm->get($rbacConfig['identity_provider']);
$rbacService = $sm->get('ZfcRbac\Service\Rbac');
if (method_exists($identityProvider, 'getIdentity')) {
$identity = $identityProvider->getIdentity();
$this->collectedRoles = $identity->getRoles();
if (method_exists($identityProvider, 'getIdentity') && method_exists($identityProvider, 'hasIdentity')) {
if ($identityProvider->hasIdentity()) {
$identity = $identityProvider->getIdentity();
$this->collectedRoles = $identity->getRoles();
}
} else {
$rbac = $rbacService->getRbac();
$roles = array();
Expand Down

0 comments on commit b25d8fa

Please sign in to comment.