/** * Get Acl based on given OID and Parent OID * * @param ObjectIdentityInterface $oid * @param array $sids * @param ObjectIdentityInterface $rootOid * @return RootBasedAclWrapper|\Symfony\Component\Security\Acl\Model\AclInterface */ protected function getAcl(ObjectIdentityInterface $oid, array $sids, ObjectIdentityInterface $rootOid) { $acl = $this->baseAclProvider->findAcl($oid, $sids); if ($this->baseAclProvider->isReplaceWithUnderlyingAcl($acl)) { $underlyingOid = $this->objectIdentityFactory->underlying($oid); return $this->getAcl($underlyingOid, $sids, $rootOid); } try { $rootAcl = $this->baseAclProvider->findAcl($rootOid, $sids); if ($this->baseAclProvider->isEmptyAcl($acl)) { return $rootAcl; } else { return new RootBasedAclWrapper($acl, $rootAcl); } } catch (AclNotFoundException $noRootAcl) { return $acl; } }