public function testConstruct() { $collection = new \PropelObjectCollection(); $collection->setModel('Propel\\Bundle\\PropelAclBundle\\Model\\Acl\\Entry'); $acl = new Acl($collection, $this->getAclObjectIdentity(), new PermissionGrantingStrategy()); $model = $this->createEntry(); $model->setAuditFailure(true); $model->setSecurityIdentity(SecurityIdentity::fromAclIdentity($this->getRoleSecurityIdentity())); $entry = new Entry($model, $acl); $this->assertEquals($model->getMask(), $entry->getMask()); $this->assertEquals($model->getGranting(), $entry->isGranting()); $this->assertEquals($model->getGrantingStrategy(), $entry->getStrategy()); $this->assertEquals($model->getAuditFailure(), $entry->isAuditFailure()); $this->assertEquals($model->getAuditSuccess(), $entry->isAuditSuccess()); $this->assertEquals($this->getRoleSecurityIdentity(), $entry->getSecurityIdentity()); return $entry; }
/** * Constructor. * * @param \Propel\Bundle\PropelAclBundle\Model\Acl\Entry $entry * @param \Symfony\Component\Security\Acl\Model\AclInterface $acl */ public function __construct(ModelEntry $entry, AclInterface $acl) { $this->field = $entry->getFieldName(); parent::__construct($entry, $acl); }
/** * Insert a given entry into the list on the given index by shifting all others. * * @param array $list * @param int $index * @param \Propel\Bundle\PropelAclBundle\Model\Acl\Entry\Entry $entry * * @return \Propel\Bundle\PropelAclBundle\Security\Acl\Domain\MutableAcl $this */ protected function insertToList(array &$list, $index, Entry $entry) { $this->isWithinBounds($list, $index); if ($entry instanceof FieldEntry) { $this->updateFields($entry->getField()); } $list = array_merge(array_slice($list, 0, $index), array($entry), array_splice($list, $index)); return $this; }