/** * Constructor. * * @param \PropelObjectCollection $entries * @param \Symfony\Component\Security\Acl\Model\ObjectIdentityInterface $objectIdentity * @param \Symfony\Component\Security\Acl\Model\PermissionGrantingStrategyInterface $permissionGrantingStrategy * @param array $loadedSecurityIdentities * @param \Symfony\Component\Security\Acl\Model\AclInterface $parentAcl * @param bool $inherited * @param \PropelPDO $con */ public function __construct(\PropelObjectCollection $entries, ObjectIdentityInterface $objectIdentity, PermissionGrantingStrategyInterface $permissionGrantingStrategy, array $loadedSecurityIdentities = array(), AclInterface $parentAcl = null, $inherited = true, \PropelPDO $con = null) { parent::__construct($entries, $objectIdentity, $permissionGrantingStrategy, $loadedSecurityIdentities, $parentAcl, $inherited); $this->modelObjectIdentity = ObjectIdentityQuery::create()->filterByAclObjectIdentity($objectIdentity, $con)->findOneOrCreate($con); if ($this->modelObjectIdentity->isNew()) { $this->modelObjectIdentity->save($con); } $this->id = $this->modelObjectIdentity->getId(); $this->con = $con; }
public function testIsFieldGrantedNoAces() { $collection = new \PropelObjectCollection(); $collection->setModel('Propel\\PropelBundle\\Model\\Acl\\Entry'); $acl = new Acl($collection, $this->getAclObjectIdentity(), new PermissionGrantingStrategy()); $this->setExpectedException('Symfony\\Component\\Security\\Acl\\Exception\\NoAceFoundException'); $acl->isFieldGranted('name', array(64), array($this->getRoleSecurityIdentity())); }