diff options
-rw-r--r-- | Acl/Voter/AclVoter.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Acl/Voter/AclVoter.php b/Acl/Voter/AclVoter.php index a32b77e..9ae4c04 100644 --- a/Acl/Voter/AclVoter.php +++ b/Acl/Voter/AclVoter.php @@ -78,14 +78,10 @@ class AclVoter implements VoterInterface } else { $field = null; } - + if ($object instanceof ObjectIdentityInterface) { $oid = $object; - } else { - $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object); - } - - if (null === $oid) { + } else if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { if (null !== $this->logger) { $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); } |