2

I have read the Symfony2 Security/ACL API but I can not find the way to update/delete and acl_security_identities.

I use this code to remove the aces of user. When I delete all the aces from a user to object I would like also delete the record in table acl_security_identities

$idObjeto = ObjectIdentity::fromDomainObject($promotora);

$acl = $this->get('security.acl.provider')->findAcl($idObjeto);

# All aces of my object
$aces = $acl->getObjectAces();

# user to revoke access
$idUsuario = UserSecurityIdentity::fromAccount($usuario);

foreach($aces as $i => $ace) {
    if($idUsuario->equals($ace->getSecurityIdentity())) {

        $acl->deleteObjectAce($i);
    }
}

$this->get('security.acl.provider')->updateAcl($acl);

Is that posible? I can not find examples or documentation in the API to access that table.

Also i have this problem https://github.com/symfony/symfony/issues/5787 because i use a mail as username.. Is there any alternative to ACL?

4

1 回答 1

2

我在你的 GitHub 问题中发表了评论,并做了一个 PR,提供了删除用户的开始。

我鼓励您查看我的帖子并对其用户名进行类似的修改。https://groups.google.com/forum/#!topic/symfony2/mGTXlTWiMs8/discussion

于 2013-06-18T22:07:21.003 回答