コード例 #1
0
 /**
  * Constructs an underlying ObjectIdentity for given ObjectIdentity
  * Underlying is class level ObjectIdentity for given object level ObjectIdentity.
  *
  * @param ObjectIdentity $oid
  * @return ObjectIdentity
  * @throws InvalidAclException
  */
 public function underlying(ObjectIdentity $oid)
 {
     if ($oid->getIdentifier() === self::ROOT_IDENTITY_TYPE || $oid->getIdentifier() === ($extensionKey = $this->extensionSelector->select($oid)->getExtensionKey())) {
         throw new InvalidAclException(sprintf('Cannot get underlying ACL for %s', $oid));
     }
     return new ObjectIdentity($extensionKey, $oid->getType());
 }
コード例 #2
0
 /**
  * Retrieve the document associated with the values in the ObjectIdentity
  *
  * @param ObjectIdentity $oid
  * @return \Doctrine\MongoDB\Cursor
  */
 protected function getObjectIdentity(ObjectIdentity $oid)
 {
     $query = array("identifier" => $oid->getIdentifier(), "type" => $oid->getType());
     return $this->connection->selectCollection($this->options['oid_collection'])->findOne($query);
 }
コード例 #3
0
 protected function getOidKey(ObjectIdentity $oid)
 {
     return $oid->getIdentifier() . $oid->getType();
 }
コード例 #4
0
ファイル: AclManager.php プロジェクト: Maksold/platform
 /**
  * Gets a key used to store ACL in $this->items collection
  *
  * @param OID $oid
  * @return string
  */
 protected function getKey(OID $oid)
 {
     return $oid->getType() . '!' . $oid->getIdentifier();
 }
コード例 #5
0
 public function testConstructorWithProxy()
 {
     $id = new ObjectIdentity('fooid', 'Acme\\DemoBundle\\Proxy\\__CG__\\Symfony\\Component\\Security\\Tests\\Acl\\Domain\\TestDomainObject');
     $this->assertEquals('fooid', $id->getIdentifier());
     $this->assertEquals('Acme\\DemoBundle\\Proxy\\__CG__\\Symfony\\Component\\Security\\Tests\\Acl\\Domain\\TestDomainObject', $id->getType());
 }
コード例 #6
0
 public function testConstructor()
 {
     $id = new ObjectIdentity('fooid', 'footype');
     $this->assertEquals('fooid', $id->getIdentifier());
     $this->assertEquals('footype', $id->getType());
 }