Browse Source

Merge branch 'acl-fix' of https://github.com/comfortablynumb/symfony into security

Johannes Schmitt 14 years ago
parent
commit
6d4814c115

+ 1 - 1
src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php

@@ -776,7 +776,7 @@ QUERY;
                     $aceId = $this->connection->executeQuery($this->getSelectAccessControlEntryIdSql($classId, $objectIdentityId, $field, $i))->fetchColumn();
                     $this->loadedAces[$aceId] = $ace;
 
-                    $aceIdProperty = new \ReflectionProperty($ace, 'id');
+                    $aceIdProperty = new \ReflectionProperty('Symfony\Component\Security\Acl\Domain\Entry', 'id');
                     $aceIdProperty->setAccessible(true);
                     $aceIdProperty->setValue($ace, intval($aceId));
                 } else {

+ 3 - 1
tests/Symfony/Tests/Component/Security/Acl/Dbal/MutableAclProviderTest.php

@@ -301,11 +301,13 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
         $acl->insertObjectAce($sid, 1);
         $acl->insertClassAce($sid, 5, 0, false);
         $acl->insertObjectAce($sid, 2, 1, true);
+        $acl->insertClassFieldAce('field', $sid, 2, 0, true);
         $provider->updateAcl($acl);
 
         $acl->updateObjectAce(0, 3);
         $acl->deleteObjectAce(1);
         $acl->updateObjectAuditing(0, true, false);
+        $acl->updateClassFieldAce(0, 'field', 15);
         $provider->updateAcl($acl);
 
         $reloadProvider = $this->getProvider();
@@ -461,4 +463,4 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
     {
         return new MutableAclProvider($this->con, $this->getStrategy(), $this->getOptions(), $cache);
     }
-}
+}