sonata-project/SonataAdminBundle — Issue #541: [generate-object-acl] throwing AclAlreadyExistsException
Author: tiagojsag
Created: 2012-02-02 16:58:28+00:00
State: open

Hi,

So, I'm trying to generate ACLs for my existing DB "objects" using the provided command. At some point, I got the following error:
```[Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException]
ObjectIdentity(1, Acme\DemoBundle\Entity\Content) is already associated with an ACL.```

I traced it to ObjectAclManipulator.php. line 49. If I replace it's content with:
```try {
$acl = $this->securityHandler->createAcl($oid);
} catch (\Symfony\Component\Security\Acl\Exception\AclAlreadyExistsException $e)
{
$acl = $this->securityHandler->getObjectAcl($oid);
}```

everything works fine. The thing is yes, the line above this one are supposed (AFAIK) to find existing ACLs for the given object. However that's not happening. Any clue?