sonata-project/SonataAdminBundle — Issue #548: [generate-object-acl] Proxy class being used instead of actual Entity class
Author: tiagojsag
Created: 2012-02-06 16:59:34+00:00
State: open

hi,

So, this is something I think it will only be fixed in Symfony 2.1, unless you can do some magic here. Anyway, I leave it here so that someone can take a look, and confirm if it can or can't be fixed, and also fo future notice. The bug is the following:

On some situations, generate-object-acl picks up the Doctrine Proxy Class instead of the original Entity Class, thus making generated ACLs not work as intended. This is documented on a broader scope here:
https://github.com/symfony/symfony/pull/2035

In my particular case, it happened for one of 9 tables, and I got around this using --step and configuring ACLs for that class individually after the full db acl generation.

To detect if this is occuring, add the following to line 45 of Util/ObjectAclManipulator.php, right after the foreach starts:

```$output->writeln($oid->getType());
```

then run the command, and check to see if any Proxy class pops up.

cheers