symfony2: insert ace in class
===

I have this error when I try add ace in class:
Warning: PDO::quote() expects parameter 1 to be string, object given in /var/www/Capeps/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 568

My code:

    $oid = new ObjectIdentity('class', new Post());
        
        $aclProvider = $this->get('security.acl.provider');
        
        try {
            $acl = $aclProvider->createAcl($oid);
        } catch (AclAlreadyExistsException $exists) {
            return;
        }
        
        $builder = new MaskBuilder();
        $builder->add('view');
            $mask = $builder->get();
            
        $acl->insertClassAce(new RoleSecurityIdentity('IS_AUTHENTICATED_ANONYMOUSLY'), $mask);
        
        $aclProvider->updateAcl($acl);

Any idea?