我在课堂上尝试添加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);
有什么想法吗?