当我尝试在类中添加 ace 时出现此错误:
警告:PDO::quote() 期望参数 1 是字符串,对象在 .../vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php 第 568 行
我的代码:
$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);
任何想法?